NEW @W-19860299@ Adding changes to disable rules from being selected#410
NEW @W-19860299@ Adding changes to disable rules from being selected#410namrata111f wants to merge 3 commits intodevfrom
Conversation
b14b40c to
58eebab
Compare
| // Skip rules that are disabled in the config | ||
| const ruleOverride = this.config.getRuleOverrideFor(rule.getEngineName(), rule.getName()); | ||
| if (ruleOverride.disabled === true) { | ||
| this.emitLogEvent(LogLevel.Info, getMessage('RuleDisabledInConfig', rule.getName(), rule.getEngineName())); |
There was a problem hiding this comment.
OK a few things. First, this should not be an "info" level log because then this would appear in the terminal in the CLI and would be unnecessarily noisy. This in my opinion should just be a Debug level message. This would also be consistent with the fact we use Debug log level for the RulePropertyOverridden message over at
Second, instead of having a ton of logs (one per disabled rule), I would encourage you to collect the disabled rules and have a single log that logs all the disabled rules at once that were skipped based on the provided rule selector.
There was a problem hiding this comment.
Collecting the disabled rules and then logging makes sense, will add. But for the log level I intentionally kept it "INFO" level so that the user has visibility to the rules they have disabled in the run. While I agree existing ones are of the Debug level but they are not that much critical as well. We are just changing the severity and tags, the violations are still reported in output. @stephen-carter-at-sf do you think it would be too much of noise?
We are making this change to allow users to disable particular rules for all the files of their project.Testing details:
Case-1) When no value for the rule's disabled property is added:
Case-2) When we explicitly disable the rule from config:
No violations are reported for it and we are also adding an info log:
Case-3) If user tries to give any value other than boolean value for this property: