Class DevSkimRuleProcessor
public class DevSkimRuleProcessor
- Inheritance
-
DevSkimRuleProcessor
- Inherited Members
Constructors
DevSkimRuleProcessor(DevSkimRuleSet, DevSkimRuleProcessorOptions)
public DevSkimRuleProcessor(DevSkimRuleSet ruleSet, DevSkimRuleProcessorOptions processorOptions)
Parameters
ruleSetDevSkimRuleSetprocessorOptionsDevSkimRuleProcessorOptions
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
fileNamestringrulesIdstringpreferMultiLinebooldurationintreviewerNamestringlanguagesLanguages
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
sourceLanguagestringThe target language (to choose the right comment style)
rulesIdstringThe ID for the rule to suppress
preferMultiLineboolIf multiline comment style should be preferred
durationintDuration in days for suppression. Default 0 (unlimited)
reviewerNamestringOptional name for the manual reviewer applying suppressions
languagesLanguagesOptional 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