This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 657
fix(rome_diagnostics): fix unknown rule warning false positive #3412
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for rometools canceled.
|
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
!bench_analyzer |
MichaReiser
reviewed
Oct 12, 2022
MichaReiser
reviewed
Oct 12, 2022
MichaReiser
reviewed
Oct 12, 2022
Analyzer Benchmark Results
|
MichaReiser
reviewed
Oct 12, 2022
MichaReiser
reviewed
Oct 12, 2022
MichaReiser
approved these changes
Oct 13, 2022
Since the error we were trying to fix originated via CLI, it would have been great to add a test in the CLI crate |
It's not really a "CLI-exclusive" error, since the root cause is in the analyzer it also happens in the LSP, the only reason it doesn't show up in the editor is that we don't report warnings that are emitted during formatting |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3406
This PR changes how the "rule registry" concept of the analyzer works by splitting its various use-case into separate types implemented at different location in the codebase through a common
RegistryVisitor
trait. This trait makes it possible to differentiate between the "static registry" containing all the rules for a given language (implemented through the newvisit_registry
function replacingbuild_registry
), and various "dynamic registries" that get built on demand throughout the codebase: the analyzer holds both a fast set of all the known rules and aRuleRegistry
containing only the active rules, thelintdoc
tools builds a list of the lint rules only, the LSP also needs to build a list of the code action rules, ...Test Plan
I've added an additional test for suppression comments to ensure the analyzer does not emit an "unknown rule" diagnostic on a suppression comment for a rule whose category is disabled. The rest of the change should be covered by the existing tests for the corresponding area of the codebase.