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

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

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

charliermarsh
Copy link
Member

Closes #10900.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 12, 2024
Copy link
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

@charliermarsh charliermarsh merged commit e9870fe into main Apr 12, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/comm branch April 12, 2024 14:04
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 12, 2024
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