-
-
Notifications
You must be signed in to change notification settings - Fork 721
perf(linter): max-classes-per-file: skip when no classes
#14865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(linter): max-classes-per-file: skip when no classes
#14865
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #14865 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a performance optimization to the max-classes-per-file linter rule by implementing a should_run method that skips the rule when no classes are present in the file.
Key Changes:
- Added
should_runmethod that checks if the file contains any classes before running the rule
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
Starting to get into writing some manual rule skips now. This one should be fairly robust, as this rule will always require >0 classes in the file to return any diagnostics. Allows the rule to be filtered out and for less space needed to be allocated in the rules `Vec`.
cef7b00 to
19d168a
Compare
…asses (#14867) Similar to #14865. Allows removing this rule from the array of rules if there are no classes in the file. Benchmarks don't really show any difference here, but it might just be because we haven't yet crossed an allocation threshold (i.e., once we remove enough rules, we'll see a diff)

Starting to get into writing some manual rule skips now. This one should be fairly robust, as this rule will always require >0 classes in the file to return any diagnostics. Allows the rule to be filtered out and for less space needed to be allocated in the rules
Vec.