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

Handle singular case for incompatible rules warning #13212

Conversation

RubenVanEldik
Copy link
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
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

crates/ruff/src/commands/format.rs Outdated Show resolved Hide resolved
Co-authored-by: Micha Reiser <micha@reiser.io>
Copy link

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

Copy link
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
20 checks passed
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