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

Enforce ruff/refurb rules (FURB) #4386

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented May 23, 2024

Summary of changes

Follow-up of #4172.

Pull Request Checklist

@Avasam Avasam mentioned this pull request Jun 17, 2024
2 tasks
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the FURB branch 4 times, most recently from 39e788a to c6d0727 Compare June 28, 2024 17:30
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review June 28, 2024 17:40
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as draft June 28, 2024 17:42
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review June 28, 2024 18:08
@DimitriPapadopoulos DimitriPapadopoulos changed the title Enforce ruff/refurb rules Enforce ruff/refurb rules (FURB) Jun 28, 2024
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the FURB branch 2 times, most recently from 44c33c5 to 6b2b9ac Compare August 3, 2024 20:40
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the FURB branch 2 times, most recently from a563475 to 3477d01 Compare August 18, 2024 14:57
@Avasam
Copy link
Contributor

Avasam commented Aug 19, 2024

Looks like you're missing imports for operator

@DimitriPapadopoulos
Copy link
Contributor Author

I think I mistakenly removed the imports while rebasing. Should be fixed now.

@DimitriPapadopoulos DimitriPapadopoulos changed the title Enforce ruff/refurb rules (FURB) Enforce ruff/refurb (FURB) and ruff/flake8-comprehensions (C4) rules Dec 31, 2024
@DimitriPapadopoulos DimitriPapadopoulos changed the title Enforce ruff/refurb (FURB) and ruff/flake8-comprehensions (C4) rules Enforce more rules: ruff/refurb (FURB) and ruff/flake8-comprehensions (C4) Dec 31, 2024
FURB110 Replace ternary `if` expression with `or` operator
FURB118 Use `operator.itemgetter(0)` instead of defining a lambda
FURB142 Use of `set.add()` in a for loop
FURB167 Use of regular expression alias `re.I`
FURB167 Use of regular expression alias `re.M`
FURB167 Use of regular expression alias `re.S`
FURB167 Use of regular expression alias `re.X`
FURB188 Prefer `removesuffix` over conditionally replacing with slice.
FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the FURB branch 2 times, most recently from bf51fe7 to 282cc26 Compare January 1, 2025 12:41
@DimitriPapadopoulos DimitriPapadopoulos changed the title Enforce more rules: ruff/refurb (FURB) and ruff/flake8-comprehensions (C4) Enforce ruff/refurb rules (FURB) Jan 1, 2025
Co-authored-by: Avasam <[email protected]>
@Avasam
Copy link
Contributor

Avasam commented Jan 3, 2025

@DimitriPapadopoulos I think you're missing a ruff.toml change adding FURB

@Avasam
Copy link
Contributor

Avasam commented Jan 3, 2025

Now that this is back to being a simpler PR. @abravalheri / @jaraco refurb would also have been one of my suggestions with improvements in readability and simplifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants