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

[flake8-comprehensions] strip parentheses around generators in unnecessary-generator-set (C401) #15553

Conversation

wooly18
Copy link
Contributor

@wooly18 wooly18 commented Jan 17, 2025

Summary

Fixes parentheses not being stripped in C401. Pretty much the same as #11607 which fixed it for C400.

Test Plan

cargo nextest run

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dylwil3 dylwil3 changed the title [flake8-comprehensions] strip parentheses around generators in C401 [flake8-comprehensions] strip parentheses around generators in unnecessary-generator-set (C401) Jan 17, 2025
@dylwil3 dylwil3 added rule Implementing or modifying a lint rule fixes Related to suggested fixes for violations bug Something isn't working and removed rule Implementing or modifying a lint rule labels Jan 17, 2025
@MichaReiser
Copy link
Member

Thanks

@MichaReiser MichaReiser merged commit 1ba8e61 into astral-sh:main Jan 17, 2025
21 checks passed
@wooly18 wooly18 deleted the unnecessary-generator-set-autofix-parentheses branch January 17, 2025 17:15
dcreager added a commit that referenced this pull request Jan 17, 2025
* main:
  [red-knot] Inline `SubclassOfType::as_instance_type_of_metaclass()` (#15556)
  [`flake8-comprehensions`] strip parentheses around generators in `unnecessary-generator-set` (`C401`) (#15553)
  [`pylint`] Implement `redefined-slots-in-subclass` (`W0244`) (#9640)
  [`flake8-bugbear`] Do not raise error if keyword argument is present and target-python version is less or equals than 3.9 (`B903`) (#15549)
  [red-knot] `type[T]` is disjoint from `type[S]` if the metaclass of `T` is disjoint from the metaclass of `S` (#15547)
  [red-knot] Pure instance variables declared in class body (#15515)
  Update snapshots of #15507 with new annotated snipetts rendering (#15546)
  [`pylint`] Do not report methods with only one `EM101`-compatible `raise` (`PLR6301`) (#15507)
  Fix unstable f-string formatting for expressions containing a trailing comma (#15545)
  Support `knot.toml` files in project discovery (#15505)
  Add support for configuring knot in `pyproject.toml` files (#15493)
  Fix bracket spacing for single-element tuples in f-string expressions (#15537)
  [`flake8-simplify`] Do not emit diagnostics for expressions inside string type annotations (`SIM222`, `SIM223`) (#15405)
  [`flake8-pytest-style`] Do not emit diagnostics for empty `for` loops (`PT012`, `PT031`) (#15542)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants