Skip to content

Avoid non-augmented-assignment for reversed, non-commutative operators#10909

Merged
charliermarsh merged 1 commit intomainfrom
charlie/comm
Apr 12, 2024
Merged

Avoid non-augmented-assignment for reversed, non-commutative operators#10909
charliermarsh merged 1 commit intomainfrom
charlie/comm

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Closes #10900.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 12, 2024
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -11 violations, +0 -0 fixes in 3 projects; 41 projects unchanged)

apache/airflow (+0 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- airflow/models/taskinstance.py:1636:21: PLR6104 Use `/=` to perform an augmented assignment directly
- airflow/providers/fab/auth_manager/security_manager/override.py:2041:21: PLR6104 Use `%=` to perform an augmented assignment directly

freedomofpress/securedrop (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- securedrop/pretty_bad_protocol/_util.py:462:5: PLR6104 Use `%=` to perform an augmented assignment directly

pandas-dev/pandas (+0 -8 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- pandas/core/groupby/groupby.py:1973:13: PLR6104 Use `-=` to perform an augmented assignment directly
- pandas/core/groupby/groupby.py:4502:13: PLR6104 Use `-=` to perform an augmented assignment directly
- pandas/core/indexes/range.py:455:13: PLR6104 Use `-=` to perform an augmented assignment directly
- pandas/core/methods/selectn.py:171:13: PLR6104 Use `-=` to perform an augmented assignment directly
- pandas/io/pytables.py:4206:29: PLR6104 Use `-=` to perform an augmented assignment directly
- pandas/tests/arithmetic/test_timedelta64.py:1615:9: PLR6104 Use `/=` to perform an augmented assignment directly
- pandas/tests/arithmetic/test_timedelta64.py:1655:9: PLR6104 Use `/=` to perform an augmented assignment directly
- pandas/tests/arithmetic/test_timedelta64.py:1683:9: PLR6104 Use `/=` to perform an augmented assignment directly

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR6104 11 0 11 0 0

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.

non-augmented-assignment (PLR6104) - false positive on operators where the variable is on the other side

2 participants