Skip to content

Handle singular case for incompatible rules warning#13212

Merged
MichaReiser merged 5 commits intoastral-sh:mainfrom
RubenVanEldik:dont-use-plural-when-single-rule-warning
Sep 2, 2024
Merged

Handle singular case for incompatible rules warning#13212
MichaReiser merged 5 commits intoastral-sh:mainfrom
RubenVanEldik:dont-use-plural-when-single-rule-warning

Conversation

@RubenVanEldik
Copy link
Copy Markdown
Contributor

@RubenVanEldik RubenVanEldik commented Sep 2, 2024

When running Ruff format I got a slightly confusing message. The Ruff message was confusing, because it was in plural, even though only a single rule was giving me this error.

Summary

  • Updated the code to call warn_user_once! twice, handling both singular and plural cases separately.
  • Ensures the warning message is grammatically correct when only one incompatible rule is present.

Test Plan

It's a minor change, so the automatic tests should cover this.

- Updated the code to call `warn_user_once!` twice, handling both singular and plural cases separately.
- Ensures the warning message is grammatically correct when only one incompatible rule is present.
Copy link
Copy Markdown
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

Co-authored-by: Micha Reiser <micha@reiser.io>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Sep 2, 2024

CodSpeed Performance Report

Merging #13212 will improve performances by 4.9%

Comparing RubenVanEldik:dont-use-plural-when-single-rule-warning (a1e5734) with main (0f85769)

Summary

⚡ 1 improvements
✅ 31 untouched benchmarks

Benchmarks breakdown

Benchmark main RubenVanEldik:dont-use-plural-when-single-rule-warning Change
linter/all-with-preview-rules[numpy/globals.py] 866.2 µs 825.7 µs +4.9%

@MichaReiser MichaReiser added the cli Related to the command-line interface label Sep 2, 2024
@MichaReiser MichaReiser enabled auto-merge (squash) September 2, 2024 11:57
auto-merge was automatically disabled September 2, 2024 12:06

Head branch was pushed to by a user without write access

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 2, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser merged commit 591a7a1 into astral-sh:main Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants