Class DevSkimRuleProcessor
public class DevSkimRuleProcessor
- Inheritance
-
DevSkimRuleProcessor
- Inherited Members
Constructors
DevSkimRuleProcessor(DevSkimRuleSet, DevSkimRuleProcessorOptions)
public DevSkimRuleProcessor(DevSkimRuleSet ruleSet, DevSkimRuleProcessorOptions processorOptions)
Parameters
ruleSet
DevSkimRuleSetprocessorOptions
DevSkimRuleProcessorOptions
Methods
Analyze(string, string)
public IEnumerable<Issue> Analyze(string text, string fileName)
Parameters
Returns
Fix(string, CodeFix)
Applies given fix on the provided source code line. Recommended to call IsFixable(string, CodeFix) first to ensure the fix is intended for the target.
public static string? Fix(string text, CodeFix fixRecord)
Parameters
Returns
- string
Fixed source code line
GenerateSuppressionByFileName(string, string, bool, int, string?, Languages?)
Generate appropriate suppression with comment style based on the filename
public static string GenerateSuppressionByFileName(string fileName, string rulesId, bool preferMultiLine = false, int duration = 0, string? reviewerName = null, Languages? languages = null)
Parameters
fileName
stringrulesId
stringpreferMultiLine
boolduration
intreviewerName
stringlanguages
Languages
Returns
GenerateSuppressionByLanguage(string, string, bool, int, string?, Languages?)
Generate suppression text for a given rule ID and language. If the comment style for the language is not specified, returns null.
public static string GenerateSuppressionByLanguage(string sourceLanguage, string rulesId, bool preferMultiLine = false, int duration = 0, string? reviewerName = null, Languages? languages = null)
Parameters
sourceLanguage
stringThe target language (to choose the right comment style)
rulesId
stringThe ID for the rule to suppress
preferMultiLine
boolIf multiline comment style should be preferred
duration
intDuration in days for suppression. Default 0 (unlimited)
reviewerName
stringOptional name for the manual reviewer applying suppressions
languages
LanguagesOptional language specifications to use
Returns
- string
A comment suppression or null if one could not be generated
IsFixable(string, CodeFix)
Checks if the target source can be fixed with the provided fix
public static bool IsFixable(string text, CodeFix fixRecord)
Parameters
Returns
- bool
Fixed source code line