You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #135, currently LintVisitor mutates the list of rules on document entry by removing rules that are excepted.
This works "fine" when the visitor visits only a single document, but when the visitor is used again to visit another document, LintVisitor will start complaining about "unknown" rules because the rule was previously removed from the rule set.
This is easily reproduced from within VS Code with the Sprocket extension.
Repro Steps
Open a WDL document in VS Code with the Sprocket extension running and with lints enabled.
Cause a lint diagnostic to show up (line no newline at end of file).
Add an #@ except for that lint rule at the top of the document.
Continue editing the file.
Expected Results
The diagnostic should be continued to be ignored.
Actual Results
A new diagnostic appears for the #@ except of the rule saying the rule is unknown.
The text was updated successfully, but these errors were encountered:
Currently `LintVisitor` will remove rules from the rule set upon document entry
when there's a "global" exception.
This works for a single document visit, but if the visitor is reused, the
subsequent visitation will treat any previously globally excepted rules as
unknown rules.
The fix is to use the `each_enabled_rule` for the `document` method so that
globally excepted rules behave like locally excepted rules and the rule set
doesn't change.
Fixesstjude-rust-labs#145.
Currently `LintVisitor` will remove rules from the rule set upon document entry
when there's a "global" exception.
This works for a single document visit, but if the visitor is reused, the
subsequent visitation will treat any previously globally excepted rules as
unknown rules.
The fix is to use the `each_enabled_rule` for the `document` method so that
globally excepted rules behave like locally excepted rules and the rule set
doesn't change.
Fixesstjude-rust-labs#145.
Overview
Related to #135, currently
LintVisitor
mutates the list of rules on document entry by removing rules that are excepted.This works "fine" when the visitor visits only a single document, but when the visitor is used again to visit another document,
LintVisitor
will start complaining about "unknown" rules because the rule was previously removed from the rule set.This is easily reproduced from within VS Code with the Sprocket extension.
Repro Steps
#@ except
for that lint rule at the top of the document.Expected Results
The diagnostic should be continued to be ignored.
Actual Results
A new diagnostic appears for the
#@ except
of the rule saying the rule is unknown.The text was updated successfully, but these errors were encountered: