Skip to content

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Oct 21, 2025

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.

Copy link
Member Author

camchenry commented Oct 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the A-linter Area - Linter label Oct 21, 2025
@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Oct 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 21, 2025

CodSpeed Performance Report

Merging #14865 will not alter performance

Comparing 10-21-perf_linter_max-classes-per-file_skip_when_no_classes (cef7b00) with main (a1cda35)

Summary

✅ 4 untouched
⏩ 33 skipped1

Footnotes

  1. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Contributor

Copilot AI left a 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_run method 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.

Copy link
Contributor

camc314 commented Oct 22, 2025

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`.
@graphite-app graphite-app bot force-pushed the 10-21-perf_linter_max-classes-per-file_skip_when_no_classes branch from cef7b00 to 19d168a Compare October 22, 2025 08:14
@graphite-app graphite-app bot merged commit 19d168a into main Oct 22, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 10-21-perf_linter_max-classes-per-file_skip_when_no_classes branch October 22, 2025 08:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 22, 2025
graphite-app bot pushed a commit that referenced this pull request Oct 22, 2025
…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)
graphite-app bot pushed a commit that referenced this pull request Oct 22, 2025
…are any classes (#14869)

Same story as #14865.

Initial codspeed benchmark showed an anomalously large drop, though I'm not sure why. I'd expect a measurable but very small improvement.
@camc314 camc314 self-assigned this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants