-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass
Checker
by immutable reference to lint rules (#16012)
This very large PR changes the field `.diagnostics` in the `Checker` from a `Vec<Diagnostic>` to a `RefCell<Vec<Diagnostic>>`, adds methods to push new diagnostics to this cell, and then removes unnecessary mutability throughout all of our lint rule implementations. Consequently, the compiler may now enforce what was, till now, the _convention_ that the only changes to the `Checker` that can happen during a lint are the addition of diagnostics[^1]. The PR is best reviewed commit-by-commit. I have tried to keep the large commits limited to "bulk actions that you can easily see are performing the same find/replace on a large number of files", and separate anything ad-hoc or with larger diffs. Please let me know if there's anything else I can do to make this easier to review! Many thanks to [`ast-grep`](https://github.com/ast-grep/ast-grep), [`helix`](https://github.com/helix-editor/helix), and good ol' fashioned`git` magic, without which this PR would have taken the rest of my natural life. [^1]: And randomly also the seen variables violating `flake8-bugbear`?
- Loading branch information
Showing
552 changed files
with
1,751 additions
and
2,288 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.