Skip to content
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

refactor(linter/yoda): simplify code #7941

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Dec 16, 2024

Follow-on after #7679.

Simplify do_diagnostic_with_fix, in particular the search for the operator. Also reduce span() calls, as they have a cost.

Copy link
Contributor Author


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 A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 16, 2024
@overlookmotel overlookmotel marked this pull request as ready for review December 16, 2024 14:25
@overlookmotel
Copy link
Contributor Author

As discussed in #7679 (comment).

Copy link

codspeed-hq bot commented Dec 16, 2024

CodSpeed Performance Report

Merging #7941 will not alter performance

Comparing 12-16-refactor_linter_yoda_simplify_code (ff2a68f) with main (6f41d92)

Summary

✅ 29 untouched benchmarks

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Dec 16, 2024
Copy link
Member

Boshen commented Dec 16, 2024

Merge activity

  • Dec 16, 11:40 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 16, 11:40 AM EST: A user added this pull request to the Graphite merge queue.
  • Dec 16, 11:45 AM EST: A user merged this pull request with the Graphite merge queue.

Follow-on after #7679.

Simplify `do_diagnostic_with_fix`, in particular the search for the operator. Also reduce `span()` calls, as they have a cost.
@Boshen Boshen force-pushed the 12-16-refactor_linter_yoda_simplify_code branch from 2665416 to ff2a68f Compare December 16, 2024 16:41
@graphite-app graphite-app bot merged commit ff2a68f into main Dec 16, 2024
25 checks passed
@graphite-app graphite-app bot deleted the 12-16-refactor_linter_yoda_simplify_code branch December 16, 2024 16:45
Boshen added a commit that referenced this pull request Dec 17, 2024
## [0.15.3] - 2024-12-17

### Features

- 25ddb35 linter: Add the import/no_named_default rule (#7902)
(Guillaume Piedigrossi)
- ee26b44 linter: Enhance `get_element_type` to resolve more element
types (#7885) (dalaoshu)

### Bug Fixes

- 6f41d92 linter: False positive in `unicorn/no-useless-spread` (#7940)
(dalaoshu)
- 0867b40 linter: Fix configuration parser for `no-restricted-imports`
(#7921) (Alexander S.)
- 9c9b73d linter: Fix incorrect fixer for `prefer-regexp-test` (#7898)
(Cameron)
- 32935e6 linter: False positive in
`jsx-a11y/label-has-associated-control` (#7881) (dalaoshu)
- 14c51ff semantic: Remove inherting `ScopeFlags::Modifier` from parent
scope (#7932) (Dunqing)

### Refactor

- 3858221 global: Sort imports (#7883) (overlookmotel)
- b99ee37 linter: Move rule "no-restricted-imports" to nursery (#7897)
(Alexander S.)
- ff2a68f linter/yoda: Simplify code (#7941) (overlookmotel)

### Styling

- 7fb9d47 rust: `cargo +nightly fmt` (#7877) (Boshen)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants