Skip to content

Fix SIM222 and SIM223 false positives and auto-fix#4063

Merged
charliermarsh merged 10 commits intoastral-sh:mainfrom
JonathanPlasse:fix-sim222-sim223-false-positive-with-truthy-expressions
Apr 25, 2023
Merged

Fix SIM222 and SIM223 false positives and auto-fix#4063
charliermarsh merged 10 commits intoastral-sh:mainfrom
JonathanPlasse:fix-sim222-sim223-false-positive-with-truthy-expressions

Conversation

@JonathanPlasse
Copy link
Copy Markdown
Contributor

@JonathanPlasse JonathanPlasse commented Apr 22, 2023

Special case truthy expressions like side-effect expressions.
If a truthy expression is followed by the short-circuiting boolean, remove the short-circuiting boolean too as it is unnecessary.
The violation message should be changed in this case to something like "remove everything after the truth expression".

assert ("foo" and False) == "foo"
assert ("foo" or True) == "foo"

I use Truthiness from flake8-bandit, but flake8-pytest also has is_falsy_constant().
Should we make extract Truthiness from flake8-bandit, add the missing cases from flake8-pytest, and use it for flake8-bandit, flake8-pytest, and flake8-simplify?
I would be open making another PR for this.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 22, 2023

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+0, -1, 0 error(s))

airflow (+0, -1)

- airflow/providers/apache/kafka/operators/consume.py:100:29: SIM222 [*] Use `True` instead of `... or True`

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     15.5±0.04ms     2.6 MB/sec    1.00     15.4±0.02ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.9±0.01ms     4.3 MB/sec    1.00      3.9±0.01ms     4.3 MB/sec
linter/all-rules/numpy/globals.py          1.03    431.4±8.32µs     6.8 MB/sec    1.00    420.7±1.34µs     7.0 MB/sec
linter/all-rules/pydantic/types.py         1.01      6.6±0.01ms     3.9 MB/sec    1.00      6.6±0.01ms     3.9 MB/sec
linter/default-rules/large/dataset.py      1.02      8.2±0.02ms     4.9 MB/sec    1.00      8.1±0.01ms     5.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1791.0±3.17µs     9.3 MB/sec    1.00   1775.1±4.08µs     9.4 MB/sec
linter/default-rules/numpy/globals.py      1.00    184.6±0.93µs    16.0 MB/sec    1.00    185.5±1.35µs    15.9 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.7±0.01ms     6.8 MB/sec    1.00      3.7±0.01ms     6.9 MB/sec
parser/large/dataset.py                    1.00      6.4±0.01ms     6.4 MB/sec    1.01      6.5±0.00ms     6.3 MB/sec
parser/numpy/ctypeslib.py                  1.00   1257.8±1.34µs    13.2 MB/sec    1.01   1272.6±1.50µs    13.1 MB/sec
parser/numpy/globals.py                    1.00    126.4±0.35µs    23.4 MB/sec    1.01    127.5±0.30µs    23.1 MB/sec
parser/pydantic/types.py                   1.00      2.8±0.00ms     9.3 MB/sec    1.01      2.8±0.00ms     9.2 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.01     17.6±0.33ms     2.3 MB/sec    1.00     17.4±0.29ms     2.3 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.4±0.07ms     3.8 MB/sec    1.02      4.5±0.08ms     3.7 MB/sec
linter/all-rules/numpy/globals.py          1.00   546.1±11.96µs     5.4 MB/sec    1.00   548.7±10.70µs     5.4 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.3±0.10ms     3.5 MB/sec    1.01      7.4±0.11ms     3.4 MB/sec
linter/default-rules/large/dataset.py      1.00      8.8±0.06ms     4.6 MB/sec    1.03      9.1±0.14ms     4.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1925.1±18.13µs     8.6 MB/sec    1.03  1976.8±26.42µs     8.4 MB/sec
linter/default-rules/numpy/globals.py      1.00    216.5±3.16µs    13.6 MB/sec    1.03   223.7±13.01µs    13.2 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.0±0.06ms     6.4 MB/sec    1.02      4.1±0.06ms     6.2 MB/sec
parser/large/dataset.py                    1.00      7.0±0.07ms     5.8 MB/sec    1.01      7.0±0.04ms     5.8 MB/sec
parser/numpy/ctypeslib.py                  1.00  1326.4±21.77µs    12.6 MB/sec    1.01  1335.3±15.68µs    12.5 MB/sec
parser/numpy/globals.py                    1.00    131.9±2.01µs    22.4 MB/sec    1.01    133.7±2.12µs    22.1 MB/sec
parser/pydantic/types.py                   1.00      3.0±0.04ms     8.4 MB/sec    1.00      3.0±0.03ms     8.4 MB/sec

@charliermarsh
Copy link
Copy Markdown
Member

Yeah, I'd vote to extract that concept into ruff_python_semantic and use it in more places!

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

I added in_test to Context.
It is considered to be in a test context when you are inside an if or an assert test, or inside the builtin bool.
Boolean operations inside other expressions than boolean operations are not in a test context.

For example:

# Inside test `a` is simplified

bool(a or [1] or True or [2])

assert a or [1] or True or [2]

if (a or [1] or True or [2]) and (a or [1] or True or [2]):
    pass

# Outside test `a` is not simplified

a or [1] or True or [2]

if (a or [1] or True or [2]) == (a or [1]):
    pass

if f(a or [1] or True or [2]):
    pass

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

There is a false positive that has been fixed in airflow.

self.max_messages = max_messages or True

@JonathanPlasse JonathanPlasse changed the title Fix SIM222 SIM223 false positive with truthy value Fix SIM222 and SIM223 false positives and auto-fix Apr 23, 2023
@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

Should I split this PR?

@charliermarsh
Copy link
Copy Markdown
Member

I think it would be helpful. What do you think we can carve out into separate PRs?

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

JonathanPlasse commented Apr 23, 2023

Here is the list of possible PRs

  1. Move Truthiness into ruff_python_ast #4071
  2. Add in_boolean_test to Context #4072
  3. Fix SIM222 and SIM223 false positives and auto-fix #4063 (This PR)

I will rebase this PR on main after the first two are merged.

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

The rebase is done.
It is ready for review.

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

I will document the rules as we diverge a lot from the behavior of flake8-simplify.

@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

I documented the rules and detect when ... or True, True or ..., or ... or True or ... is used and adapted the violation message.

@charliermarsh charliermarsh enabled auto-merge (squash) April 25, 2023 04:39
@charliermarsh charliermarsh merged commit 1f3b0fd into astral-sh:main Apr 25, 2023
@charliermarsh charliermarsh added the bug Something isn't working label Apr 25, 2023
@JonathanPlasse JonathanPlasse deleted the fix-sim222-sim223-false-positive-with-truthy-expressions branch April 25, 2023 07:05
@JonathanPlasse
Copy link
Copy Markdown
Contributor Author

You for your edits, it is much cleaner and clearer now.

renovate bot referenced this pull request in ixm-one/pytest-cmake-presets Apr 25, 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) | `^0.0.262` ->
`^0.0.263` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Rules

- \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by
[@&#8203;alanhdu](https://togithub.com/alanhdu) in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- \[`flake8-import-conventions`] Implement new rule `ICN003` to ban
`from ... import ...` for selected modules by
[@&#8203;edgarrmondragon](https://togithub.com/edgarrmondragon) in
[https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040)
- \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by
[@&#8203;mccullocht](https://togithub.com/mccullocht) in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)
- \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066)

##### Bug Fixes

- Avoid `PYI015` for valid default value without annotation by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043)
- Avoid infinite-propagation of inline comments when force-splitting
imports by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074)
- Fix SIM222 and SIM223 false positives and auto-fix by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063)
- Unify positional and keyword arguments when checking for missing
arguments in docstring by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067)
- Avoid `RUF008` if field annotation is immutable by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039)
- Increment priority should be (branch-local, global) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070)
- Ignore `ClassVar` annotation for `RUF008`, `RUF009` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081)
- Support --fix in watch mode by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035)

#### New Contributors

- [@&#8203;alanhdu](https://togithub.com/alanhdu) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- [@&#8203;pronoym99](https://togithub.com/pronoym99) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055)
- [@&#8203;Secrus](https://togithub.com/Secrus) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085)
- [@&#8203;madkinsz](https://togithub.com/madkinsz) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084)
- [@&#8203;mccullocht](https://togithub.com/mccullocht) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)

**Full Changelog**:
astral-sh/ruff@v0.0.262...v0.0.263

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9-->

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/flux-local Apr 27, 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) | `==0.0.262` ->
`==0.0.263` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Rules

- \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by
[@&#8203;alanhdu](https://togithub.com/alanhdu) in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- \[`flake8-import-conventions`] Implement new rule `ICN003` to ban
`from ... import ...` for selected modules by
[@&#8203;edgarrmondragon](https://togithub.com/edgarrmondragon) in
[https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040)
- \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by
[@&#8203;mccullocht](https://togithub.com/mccullocht) in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)
- \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066)

##### Bug Fixes

- Avoid `PYI015` for valid default value without annotation by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043)
- Avoid infinite-propagation of inline comments when force-splitting
imports by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074)
- Fix SIM222 and SIM223 false positives and auto-fix by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063)
- Unify positional and keyword arguments when checking for missing
arguments in docstring by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067)
- Avoid `RUF008` if field annotation is immutable by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039)
- Increment priority should be (branch-local, global) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070)
- Ignore `ClassVar` annotation for `RUF008`, `RUF009` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081)
- Support --fix in watch mode by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035)

#### New Contributors

- [@&#8203;alanhdu](https://togithub.com/alanhdu) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- [@&#8203;pronoym99](https://togithub.com/pronoym99) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055)
- [@&#8203;Secrus](https://togithub.com/Secrus) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085)
- [@&#8203;madkinsz](https://togithub.com/madkinsz) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084)
- [@&#8203;mccullocht](https://togithub.com/mccullocht) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)

**Full Changelog**:
astral-sh/ruff@v0.0.262...v0.0.263

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/pyrainbird Apr 27, 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) | `==0.0.262` ->
`==0.0.263` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/compatibility-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.263/confidence-slim/0.0.262)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

##### What's Changed

##### Rules

- \[`flake8-bugbear`] Add `pytest.raises(Exception)` support to B017 by
[@&#8203;alanhdu](https://togithub.com/alanhdu) in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- \[`flake8-import-conventions`] Implement new rule `ICN003` to ban
`from ... import ...` for selected modules by
[@&#8203;edgarrmondragon](https://togithub.com/edgarrmondragon) in
[https://github.com/charliermarsh/ruff/pull/4040](https://togithub.com/charliermarsh/ruff/pull/4040)
- \[`pylint`] Implement PLE0302 `unexpected-special-method-signature` by
[@&#8203;mccullocht](https://togithub.com/mccullocht) in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)
- \[`pep8-naming`] Ignore `N815` for `TypedDict` fields by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4066](https://togithub.com/charliermarsh/ruff/pull/4066)

##### Bug Fixes

- Avoid `PYI015` for valid default value without annotation by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4043](https://togithub.com/charliermarsh/ruff/pull/4043)
- Avoid infinite-propagation of inline comments when force-splitting
imports by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[https://github.com/charliermarsh/ruff/pull/4074](https://togithub.com/charliermarsh/ruff/pull/4074)
- Fix SIM222 and SIM223 false positives and auto-fix by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/4063](https://togithub.com/charliermarsh/ruff/pull/4063)
- Unify positional and keyword arguments when checking for missing
arguments in docstring by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4067](https://togithub.com/charliermarsh/ruff/pull/4067)
- Avoid `RUF008` if field annotation is immutable by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4039](https://togithub.com/charliermarsh/ruff/pull/4039)
- Increment priority should be (branch-local, global) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4070](https://togithub.com/charliermarsh/ruff/pull/4070)
- Ignore `ClassVar` annotation for `RUF008`, `RUF009` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4081](https://togithub.com/charliermarsh/ruff/pull/4081)
- Support --fix in watch mode by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/charliermarsh/ruff/pull/4035](https://togithub.com/charliermarsh/ruff/pull/4035)

##### New Contributors

- [@&#8203;alanhdu](https://togithub.com/alanhdu) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4052](https://togithub.com/charliermarsh/ruff/pull/4052)
- [@&#8203;pronoym99](https://togithub.com/pronoym99) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4055](https://togithub.com/charliermarsh/ruff/pull/4055)
- [@&#8203;Secrus](https://togithub.com/Secrus) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4085](https://togithub.com/charliermarsh/ruff/pull/4085)
- [@&#8203;madkinsz](https://togithub.com/madkinsz) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4084](https://togithub.com/charliermarsh/ruff/pull/4084)
- [@&#8203;mccullocht](https://togithub.com/mccullocht) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4075](https://togithub.com/charliermarsh/ruff/pull/4075)

**Full Changelog**:
astral-sh/ruff@v0.0.262...v0.0.263

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS41OC4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTguMiJ9-->

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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIM222 False positive

3 participants