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

Update C419 to be a suggested fix #4424

Merged
merged 1 commit into from
May 15, 2023
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented May 14, 2023

Per discussion in #4320
Part of #4184

@@ -1312,5 +1312,8 @@ pub(crate) fn fix_unnecessary_comprehension_any_all(
};
tree.codegen(&mut state);

Ok(Edit::range_replacement(state.to_string(), expr.range()))
Ok(Fix::suggested(Edit::range_replacement(
Copy link
Member Author

Choose a reason for hiding this comment

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

It's not entirely clear to me if the applicability should be decided here in fixes.rs or rules/...

Copy link
Member

Choose a reason for hiding this comment

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

I think either is fine since the method is only used in unnecessary_comprehension_any_all (that's why I personally would move the function and co-locate it with the rule).

Another reasoning: If we always know that a certain Edit is potentially unsafe, then it's okay to decide in the helper method.

@github-actions
Copy link
Contributor

github-actions bot commented May 14, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     14.6±0.06ms     2.8 MB/sec    1.00     14.6±0.04ms     2.8 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.6±0.00ms     4.6 MB/sec    1.00      3.6±0.00ms     4.7 MB/sec
linter/all-rules/numpy/globals.py          1.01    365.2±1.16µs     8.1 MB/sec    1.00    362.7±1.54µs     8.1 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.1±0.01ms     4.2 MB/sec    1.00      6.1±0.01ms     4.2 MB/sec
linter/default-rules/large/dataset.py      1.00      7.3±0.02ms     5.6 MB/sec    1.00      7.2±0.02ms     5.6 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1508.3±8.55µs    11.0 MB/sec    1.00   1500.5±4.09µs    11.1 MB/sec
linter/default-rules/numpy/globals.py      1.00    162.4±0.29µs    18.2 MB/sec    1.01    163.7±0.37µs    18.0 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.2±0.01ms     7.9 MB/sec    1.00      3.2±0.01ms     7.9 MB/sec
parser/large/dataset.py                    1.01      5.8±0.01ms     7.0 MB/sec    1.00      5.7±0.01ms     7.1 MB/sec
parser/numpy/ctypeslib.py                  1.00   1125.9±2.34µs    14.8 MB/sec    1.00   1121.8±2.63µs    14.8 MB/sec
parser/numpy/globals.py                    1.00    115.3±0.29µs    25.6 MB/sec    1.00    115.1±1.00µs    25.6 MB/sec
parser/pydantic/types.py                   1.01      2.5±0.01ms    10.4 MB/sec    1.00      2.4±0.00ms    10.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.02     16.4±0.19ms     2.5 MB/sec    1.00     16.1±0.18ms     2.5 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.1±0.06ms     4.0 MB/sec    1.00      4.1±0.04ms     4.1 MB/sec
linter/all-rules/numpy/globals.py          1.00    482.3±5.85µs     6.1 MB/sec    1.00    480.1±5.60µs     6.1 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.8±0.11ms     3.8 MB/sec    1.00      6.8±0.09ms     3.8 MB/sec
linter/default-rules/large/dataset.py      1.01      8.0±0.07ms     5.1 MB/sec    1.00      7.9±0.05ms     5.1 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.02  1695.9±32.59µs     9.8 MB/sec    1.00  1665.9±17.83µs    10.0 MB/sec
linter/default-rules/numpy/globals.py      1.00    187.2±2.24µs    15.8 MB/sec    1.02    190.1±5.45µs    15.5 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.6±0.03ms     7.2 MB/sec    1.01      3.6±0.09ms     7.1 MB/sec
parser/large/dataset.py                    1.00      6.6±0.05ms     6.2 MB/sec    1.00      6.6±0.04ms     6.2 MB/sec
parser/numpy/ctypeslib.py                  1.00  1252.8±14.35µs    13.3 MB/sec    1.00  1254.4±12.71µs    13.3 MB/sec
parser/numpy/globals.py                    1.00    128.7±1.55µs    22.9 MB/sec    1.00    128.9±1.60µs    22.9 MB/sec
parser/pydantic/types.py                   1.00      2.8±0.03ms     9.1 MB/sec    1.00      2.8±0.05ms     9.1 MB/sec

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.

The code itself looks good to me but I don't have enough python knowledge to assess the situations in which rewriting [i for i in a] into i for i in a is semantically different. @madkinsz can you explain your reasoning or @konstin @charliermarsh can you review the categorisation?

@@ -1312,5 +1312,8 @@ pub(crate) fn fix_unnecessary_comprehension_any_all(
};
tree.codegen(&mut state);

Ok(Edit::range_replacement(state.to_string(), expr.range()))
Ok(Fix::suggested(Edit::range_replacement(
Copy link
Member

Choose a reason for hiding this comment

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

I think either is fine since the method is only used in unnecessary_comprehension_any_all (that's why I personally would move the function and co-locate it with the rule).

Another reasoning: If we always know that a certain Edit is potentially unsafe, then it's okay to decide in the helper method.

@konstin
Copy link
Member

konstin commented May 15, 2023

Technically, we're changing eager to lazy, e.g.:

from typing import Generator


def count() -> Generator[int, None, None]:
    for i in range(4):
        print(i)
        yield i


if __name__ == "__main__":
    print("pre fix")
    any([i > 0 for i in count()])
    print("after fix")
    any(i > 0 for i in count())
pre fix
0
1
2
3
after fix
0
1

I expect that this being a problem is rare, it would mean that your code relies on a generator being used to completion. A more common problem could be that we don't resolve the call path yet and sometimes people rebind any/all:

https://github.com/charliermarsh/ruff/blob/c10a4535b9549d8dab6dec024ce3231b74bf5e18/crates/ruff/src/rules/flake8_comprehensions/rules/unnecessary_comprehension_any_all.rs#L72

I think suggested is the correct category.

@MichaReiser
Copy link
Member

Thx

@MichaReiser MichaReiser merged commit 2c6efc2 into astral-sh:main May 15, 2023
renovate bot referenced this pull request in ixm-one/pytest-cmake-presets May 19, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff)
([changelog](https://togithub.com/charliermarsh/ruff/releases)) |
`^0.0.267` -> `^0.0.269` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/compatibility-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/confidence-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.269`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.269)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.267...v0.0.269)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

(This is a rerelease of `v0.0.268`, which didn't make it to PyPI due to
user error. As such, the release notes are copied below.)

##### `pycodestyle`

This release includes optimized implementations of a large portion of
`pycodestyle`, for those that use Ruff without an autoformatter.

In this initial release, the rules are being introduced under a
"nursery" flag, which requires that users explicitly select them (e.g.,
`select = ["E111"]`); in other words, these rules are not yet enabled
via `select = ["E"]`.

If you're interested in testing the `pycodestyle` rules, you can enable
them via:

```toml
select = [
    "E111", "E112", "E113", "E114", "E115", "E116", "E117",
    "E201", "E202", "E203", "E211", "E221", "E222", "E223",
    "E224", "E225", "E226", "E227", "E228", "E231", "E251",
    "E252", "E261", "E262", "E265", "E266", "E271", "E272",
    "E273", "E274", "E275",
]
```

These rules will be included as part of the `E` category in a future
release.

##### Breaking Changes

- \[`pyupgrade`] Remove `keep-runtime-typing` setting by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4427](https://togithub.com/charliermarsh/ruff/pull/4427)

##### Rules

- \[`pylint`] Add `duplicate-bases` rule by
[@&#8203;alonme](https://togithub.com/alonme) in
[https://github.com/charliermarsh/ruff/pull/4411](https://togithub.com/charliermarsh/ruff/pull/4411)
- \[`pylint`] Fix `PLW3301` auto-fix with generators by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4412](https://togithub.com/charliermarsh/ruff/pull/4412)
- \[`flake8-async`] Implement flake8-async plugin by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- \[`pyupgrade`] Enable automatic rewrites of `typing.Deque` and
`typing.DefaultDict` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4420](https://togithub.com/charliermarsh/ruff/pull/4420)
- \[`flake8-pyi`] Implement `unannotated-assignment-in-stub` (`PY052`)
by [@&#8203;sladyn98](https://togithub.com/sladyn98) in
[https://github.com/charliermarsh/ruff/pull/4293](https://togithub.com/charliermarsh/ruff/pull/4293)
- \[`tryceratops`] Implement TRY302 - `raise` after `except` by
[@&#8203;john-h-k](https://togithub.com/john-h-k) in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)
- \[`flake8-bandit`] Improve SQL injection detection logic (`S608`) by
[@&#8203;scop](https://togithub.com/scop) in
[https://github.com/charliermarsh/ruff/pull/4499](https://togithub.com/charliermarsh/ruff/pull/4499)
- \[`flake8-todos`] Implement `flake8_todos` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/3921](https://togithub.com/charliermarsh/ruff/pull/3921)
- \[`flake8-future-annotations`] Implement `flake8-future-annotations`
FA100 by [@&#8203;TylerYep](https://togithub.com/TylerYep) in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- Enable `pycodestyle` rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3689](https://togithub.com/charliermarsh/ruff/pull/3689)
- Enable `pycodestyle` rules under new "nursery" category by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4407](https://togithub.com/charliermarsh/ruff/pull/4407)

##### Settings

- Merge subsettings when extending configurations by
[@&#8203;bendoerry](https://togithub.com/bendoerry) in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)

##### Bug Fixes

- Extend multi-line noqa directives to start-of-line by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4490](https://togithub.com/charliermarsh/ruff/pull/4490)
- Fix scoping of comprehensions within classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4494](https://togithub.com/charliermarsh/ruff/pull/4494)
- Enable autofix for split-assertions at top level by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4405](https://togithub.com/charliermarsh/ruff/pull/4405)
- Ignore ANN401 for overridden methods by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4409](https://togithub.com/charliermarsh/ruff/pull/4409)
- Fix `RUF010` autofix within f-strings by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4423](https://togithub.com/charliermarsh/ruff/pull/4423)
- Update C419 to be a suggested fix by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4424](https://togithub.com/charliermarsh/ruff/pull/4424)
- Fix expected-indentation errors with end-of-line comments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4438](https://togithub.com/charliermarsh/ruff/pull/4438)
- Emit non-logical newlines for "empty" lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4444](https://togithub.com/charliermarsh/ruff/pull/4444)
- Avoid emitting empty logical lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4452](https://togithub.com/charliermarsh/ruff/pull/4452)
- Avoid flagging missing whitespace for decorators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4454](https://togithub.com/charliermarsh/ruff/pull/4454)
- Remove special-casing for whitespace-around-@&#8203; by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4458](https://togithub.com/charliermarsh/ruff/pull/4458)
- Avoid triggering `pd#at` and friends on non-subscripts by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4474](https://togithub.com/charliermarsh/ruff/pull/4474)
- Include precise tokens for extraneous-whitespace diagnostics by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4471](https://togithub.com/charliermarsh/ruff/pull/4471)
- Allow shebang comments at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4473](https://togithub.com/charliermarsh/ruff/pull/4473)
- Bring pycodestyle rules into full compatibility (on SciPy) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4472](https://togithub.com/charliermarsh/ruff/pull/4472)
- Invert quote-style when generating code within f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4487](https://togithub.com/charliermarsh/ruff/pull/4487)
- Fix COM812 false positive in string subscript by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4493](https://togithub.com/charliermarsh/ruff/pull/4493)
- Overhaul sdist handling by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/charliermarsh/ruff/pull/4439](https://togithub.com/charliermarsh/ruff/pull/4439)

#### New Contributors

- [@&#8203;TylerYep](https://togithub.com/TylerYep) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- [@&#8203;yanksyoon](https://togithub.com/yanksyoon) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4428](https://togithub.com/charliermarsh/ruff/pull/4428)
- [@&#8203;bendoerry](https://togithub.com/bendoerry) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)
- [@&#8203;qdegraaf](https://togithub.com/qdegraaf) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- [@&#8203;jameslamb](https://togithub.com/jameslamb) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4446](https://togithub.com/charliermarsh/ruff/pull/4446)
- [@&#8203;john-h-k](https://togithub.com/john-h-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)

**Full Changelog**:
astral-sh/ruff@v0.0.267...v0.0.269

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45NS4xIiwidXBkYXRlZEluVmVyIjoiMzUuOTUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/pyrainbird May 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff)
([changelog](https://togithub.com/charliermarsh/ruff/releases)) |
`==0.0.267` -> `==0.0.269` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/compatibility-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/confidence-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.269`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.269)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.267...v0.0.269)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

(This is a rerelease of `v0.0.268`, which didn't make it to PyPI due to
user error. As such, the release notes are copied below.)

##### `pycodestyle`

This release includes optimized implementations of a large portion of
`pycodestyle`, for those that use Ruff without an autoformatter.

In this initial release, the rules are being introduced under a
"nursery" flag, which requires that users explicitly select them (e.g.,
`select = ["E111"]`); in other words, these rules are not yet enabled
via `select = ["E"]`.

If you're interested in testing the `pycodestyle` rules, you can enable
them via:

```toml
select = [
    "E111", "E112", "E113", "E114", "E115", "E116", "E117",
    "E201", "E202", "E203", "E211", "E221", "E222", "E223",
    "E224", "E225", "E226", "E227", "E228", "E231", "E251",
    "E252", "E261", "E262", "E265", "E266", "E271", "E272",
    "E273", "E274", "E275",
]
```

These rules will be included as part of the `E` category in a future
release.

##### Breaking Changes

- \[`pyupgrade`] Remove `keep-runtime-typing` setting by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4427](https://togithub.com/charliermarsh/ruff/pull/4427)

##### Rules

- \[`pylint`] Add `duplicate-bases` rule by
[@&#8203;alonme](https://togithub.com/alonme) in
[https://github.com/charliermarsh/ruff/pull/4411](https://togithub.com/charliermarsh/ruff/pull/4411)
- \[`pylint`] Fix `PLW3301` auto-fix with generators by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4412](https://togithub.com/charliermarsh/ruff/pull/4412)
- \[`flake8-async`] Implement flake8-async plugin by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- \[`pyupgrade`] Enable automatic rewrites of `typing.Deque` and
`typing.DefaultDict` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4420](https://togithub.com/charliermarsh/ruff/pull/4420)
- \[`flake8-pyi`] Implement `unannotated-assignment-in-stub` (`PY052`)
by [@&#8203;sladyn98](https://togithub.com/sladyn98) in
[https://github.com/charliermarsh/ruff/pull/4293](https://togithub.com/charliermarsh/ruff/pull/4293)
- \[`tryceratops`] Implement TRY302 - `raise` after `except` by
[@&#8203;john-h-k](https://togithub.com/john-h-k) in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)
- \[`flake8-bandit`] Improve SQL injection detection logic (`S608`) by
[@&#8203;scop](https://togithub.com/scop) in
[https://github.com/charliermarsh/ruff/pull/4499](https://togithub.com/charliermarsh/ruff/pull/4499)
- \[`flake8-todos`] Implement `flake8_todos` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/3921](https://togithub.com/charliermarsh/ruff/pull/3921)
- \[`flake8-future-annotations`] Implement `flake8-future-annotations`
FA100 by [@&#8203;TylerYep](https://togithub.com/TylerYep) in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- Enable `pycodestyle` rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3689](https://togithub.com/charliermarsh/ruff/pull/3689)
- Enable `pycodestyle` rules under new "nursery" category by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4407](https://togithub.com/charliermarsh/ruff/pull/4407)

##### Settings

- Merge subsettings when extending configurations by
[@&#8203;bendoerry](https://togithub.com/bendoerry) in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)

##### Bug Fixes

- Extend multi-line noqa directives to start-of-line by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4490](https://togithub.com/charliermarsh/ruff/pull/4490)
- Fix scoping of comprehensions within classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4494](https://togithub.com/charliermarsh/ruff/pull/4494)
- Enable autofix for split-assertions at top level by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4405](https://togithub.com/charliermarsh/ruff/pull/4405)
- Ignore ANN401 for overridden methods by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4409](https://togithub.com/charliermarsh/ruff/pull/4409)
- Fix `RUF010` autofix within f-strings by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4423](https://togithub.com/charliermarsh/ruff/pull/4423)
- Update C419 to be a suggested fix by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4424](https://togithub.com/charliermarsh/ruff/pull/4424)
- Fix expected-indentation errors with end-of-line comments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4438](https://togithub.com/charliermarsh/ruff/pull/4438)
- Emit non-logical newlines for "empty" lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4444](https://togithub.com/charliermarsh/ruff/pull/4444)
- Avoid emitting empty logical lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4452](https://togithub.com/charliermarsh/ruff/pull/4452)
- Avoid flagging missing whitespace for decorators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4454](https://togithub.com/charliermarsh/ruff/pull/4454)
- Remove special-casing for whitespace-around-@&#8203; by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4458](https://togithub.com/charliermarsh/ruff/pull/4458)
- Avoid triggering `pd#at` and friends on non-subscripts by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4474](https://togithub.com/charliermarsh/ruff/pull/4474)
- Include precise tokens for extraneous-whitespace diagnostics by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4471](https://togithub.com/charliermarsh/ruff/pull/4471)
- Allow shebang comments at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4473](https://togithub.com/charliermarsh/ruff/pull/4473)
- Bring pycodestyle rules into full compatibility (on SciPy) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4472](https://togithub.com/charliermarsh/ruff/pull/4472)
- Invert quote-style when generating code within f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4487](https://togithub.com/charliermarsh/ruff/pull/4487)
- Fix COM812 false positive in string subscript by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4493](https://togithub.com/charliermarsh/ruff/pull/4493)
- Overhaul sdist handling by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/charliermarsh/ruff/pull/4439](https://togithub.com/charliermarsh/ruff/pull/4439)

#### New Contributors

- [@&#8203;TylerYep](https://togithub.com/TylerYep) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- [@&#8203;yanksyoon](https://togithub.com/yanksyoon) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4428](https://togithub.com/charliermarsh/ruff/pull/4428)
- [@&#8203;bendoerry](https://togithub.com/bendoerry) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)
- [@&#8203;qdegraaf](https://togithub.com/qdegraaf) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- [@&#8203;jameslamb](https://togithub.com/jameslamb) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4446](https://togithub.com/charliermarsh/ruff/pull/4446)
- [@&#8203;john-h-k](https://togithub.com/john-h-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)

**Full Changelog**:
astral-sh/ruff@v0.0.267...v0.0.269

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45NS4xIiwidXBkYXRlZEluVmVyIjoiMzUuOTUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/flux-local May 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff)
([changelog](https://togithub.com/charliermarsh/ruff/releases)) |
`==0.0.267` -> `==0.0.269` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/compatibility-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.269/confidence-slim/0.0.267)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.269`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.269)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.267...v0.0.269)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

(This is a rerelease of `v0.0.268`, which didn't make it to PyPI due to
user error. As such, the release notes are copied below.)

##### `pycodestyle`

This release includes optimized implementations of a large portion of
`pycodestyle`, for those that use Ruff without an autoformatter.

In this initial release, the rules are being introduced under a
"nursery" flag, which requires that users explicitly select them (e.g.,
`select = ["E111"]`); in other words, these rules are not yet enabled
via `select = ["E"]`.

If you're interested in testing the `pycodestyle` rules, you can enable
them via:

```toml
select = [
    "E111", "E112", "E113", "E114", "E115", "E116", "E117",
    "E201", "E202", "E203", "E211", "E221", "E222", "E223",
    "E224", "E225", "E226", "E227", "E228", "E231", "E251",
    "E252", "E261", "E262", "E265", "E266", "E271", "E272",
    "E273", "E274", "E275",
]
```

These rules will be included as part of the `E` category in a future
release.

##### Breaking Changes

- \[`pyupgrade`] Remove `keep-runtime-typing` setting by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4427](https://togithub.com/charliermarsh/ruff/pull/4427)

##### Rules

- \[`pylint`] Add `duplicate-bases` rule by
[@&#8203;alonme](https://togithub.com/alonme) in
[https://github.com/charliermarsh/ruff/pull/4411](https://togithub.com/charliermarsh/ruff/pull/4411)
- \[`pylint`] Fix `PLW3301` auto-fix with generators by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4412](https://togithub.com/charliermarsh/ruff/pull/4412)
- \[`flake8-async`] Implement flake8-async plugin by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- \[`pyupgrade`] Enable automatic rewrites of `typing.Deque` and
`typing.DefaultDict` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4420](https://togithub.com/charliermarsh/ruff/pull/4420)
- \[`flake8-pyi`] Implement `unannotated-assignment-in-stub` (`PY052`)
by [@&#8203;sladyn98](https://togithub.com/sladyn98) in
[https://github.com/charliermarsh/ruff/pull/4293](https://togithub.com/charliermarsh/ruff/pull/4293)
- \[`tryceratops`] Implement TRY302 - `raise` after `except` by
[@&#8203;john-h-k](https://togithub.com/john-h-k) in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)
- \[`flake8-bandit`] Improve SQL injection detection logic (`S608`) by
[@&#8203;scop](https://togithub.com/scop) in
[https://github.com/charliermarsh/ruff/pull/4499](https://togithub.com/charliermarsh/ruff/pull/4499)
- \[`flake8-todos`] Implement `flake8_todos` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/3921](https://togithub.com/charliermarsh/ruff/pull/3921)
- \[`flake8-future-annotations`] Implement `flake8-future-annotations`
FA100 by [@&#8203;TylerYep](https://togithub.com/TylerYep) in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- Enable `pycodestyle` rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3689](https://togithub.com/charliermarsh/ruff/pull/3689)
- Enable `pycodestyle` rules under new "nursery" category by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4407](https://togithub.com/charliermarsh/ruff/pull/4407)

##### Settings

- Merge subsettings when extending configurations by
[@&#8203;bendoerry](https://togithub.com/bendoerry) in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)

##### Bug Fixes

- Extend multi-line noqa directives to start-of-line by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4490](https://togithub.com/charliermarsh/ruff/pull/4490)
- Fix scoping of comprehensions within classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4494](https://togithub.com/charliermarsh/ruff/pull/4494)
- Enable autofix for split-assertions at top level by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4405](https://togithub.com/charliermarsh/ruff/pull/4405)
- Ignore ANN401 for overridden methods by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4409](https://togithub.com/charliermarsh/ruff/pull/4409)
- Fix `RUF010` autofix within f-strings by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4423](https://togithub.com/charliermarsh/ruff/pull/4423)
- Update C419 to be a suggested fix by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4424](https://togithub.com/charliermarsh/ruff/pull/4424)
- Fix expected-indentation errors with end-of-line comments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4438](https://togithub.com/charliermarsh/ruff/pull/4438)
- Emit non-logical newlines for "empty" lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4444](https://togithub.com/charliermarsh/ruff/pull/4444)
- Avoid emitting empty logical lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4452](https://togithub.com/charliermarsh/ruff/pull/4452)
- Avoid flagging missing whitespace for decorators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4454](https://togithub.com/charliermarsh/ruff/pull/4454)
- Remove special-casing for whitespace-around-@&#8203; by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4458](https://togithub.com/charliermarsh/ruff/pull/4458)
- Avoid triggering `pd#at` and friends on non-subscripts by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4474](https://togithub.com/charliermarsh/ruff/pull/4474)
- Include precise tokens for extraneous-whitespace diagnostics by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4471](https://togithub.com/charliermarsh/ruff/pull/4471)
- Allow shebang comments at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4473](https://togithub.com/charliermarsh/ruff/pull/4473)
- Bring pycodestyle rules into full compatibility (on SciPy) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4472](https://togithub.com/charliermarsh/ruff/pull/4472)
- Invert quote-style when generating code within f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4487](https://togithub.com/charliermarsh/ruff/pull/4487)
- Fix COM812 false positive in string subscript by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4493](https://togithub.com/charliermarsh/ruff/pull/4493)
- Overhaul sdist handling by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/charliermarsh/ruff/pull/4439](https://togithub.com/charliermarsh/ruff/pull/4439)

#### New Contributors

- [@&#8203;TylerYep](https://togithub.com/TylerYep) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3979](https://togithub.com/charliermarsh/ruff/pull/3979)
- [@&#8203;yanksyoon](https://togithub.com/yanksyoon) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4428](https://togithub.com/charliermarsh/ruff/pull/4428)
- [@&#8203;bendoerry](https://togithub.com/bendoerry) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4431](https://togithub.com/charliermarsh/ruff/pull/4431)
- [@&#8203;qdegraaf](https://togithub.com/qdegraaf) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4432](https://togithub.com/charliermarsh/ruff/pull/4432)
- [@&#8203;jameslamb](https://togithub.com/jameslamb) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4446](https://togithub.com/charliermarsh/ruff/pull/4446)
- [@&#8203;john-h-k](https://togithub.com/john-h-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4461](https://togithub.com/charliermarsh/ruff/pull/4461)

**Full Changelog**:
astral-sh/ruff@v0.0.267...v0.0.269

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45Ni4zIiwidXBkYXRlZEluVmVyIjoiMzUuOTYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants