wist icon indicating copy to clipboard operation
wist copied to clipboard

Allow an inline code way to override rules

Open vannuysm opened this issue 7 years ago • 3 comments

Something like a comment-based format to override rules. Maybe ' bslint "rule-name": "severity"

As an example to turn off the rule no-print you would add the following comment: ' bslint "no-print": "off"

vannuysm avatar Sep 07 '17 19:09 vannuysm

We could also go all in ESLint style and have a few different types of statements, such as ' bslint-disable, ' bslint-enable, ' bslint-disable-next-line, ' bslint-disable-line.

vannuysm avatar Sep 07 '17 20:09 vannuysm

I really like this 👍

slheavner avatar Sep 15 '17 17:09 slheavner

A new proposal that surfaced recently was to use conditional compilation constants as annotations for scoped blocks. For example

#const __suppress_wist_rule_name = true
function breakRuleHere() as Void
...
end function

#const __suppress_wist_rule_name = true
function anotherFunction() as Void
...
end function

It could also be possible use them as fenced blocks to enable and disable rules.

#const __suppress_wist_rule_name = false
function breakRuleHere() as Void
...
end function
#const __suppress_wist_rule_name = true

nishtahir avatar Mar 15 '18 20:03 nishtahir