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

[pylint] Reverse min-max logic in if-stmt-min-max #10890

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Closes #10889.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 11, 2024
@charliermarsh charliermarsh changed the title Reverse min-max logic in if-stmt-min-max [pylint] Reverse min-max logic in if-stmt-min-max Apr 11, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

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

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

+ airflow/cli/commands/kubernetes_command.py:84:5: PLR1730 [*] Replace `if` statement with `min_pending_minutes = max(min_pending_minutes, 5)`
- airflow/cli/commands/kubernetes_command.py:84:5: PLR1730 [*] Replace `if` statement with `min_pending_minutes = min(min_pending_minutes, 5)`
+ airflow/models/taskinstance.py:2171:13: PLR1730 [*] Replace `if` statement with `min_backoff = max(min_backoff, 1)`
- airflow/models/taskinstance.py:2171:13: PLR1730 [*] Replace `if` statement with `min_backoff = min(min_backoff, 1)`
- tests/cluster_policies/__init__.py:103:5: PLR1730 [*] Replace `if` statement with `max` call
+ tests/cluster_policies/__init__.py:103:5: PLR1730 [*] Replace `if` statement with `min` call

milvus-io/pymilvus (+3 -3 violations, +0 -0 fixes)

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

+ pymilvus/bulk_writer/buffer.py:234:13: PLR1730 [*] Replace `if` statement with `max` call
- pymilvus/bulk_writer/buffer.py:234:13: PLR1730 [*] Replace `if` statement with `min` call
- pymilvus/bulk_writer/buffer.py:236:13: PLR1730 [*] Replace `if` statement with `max` call
+ pymilvus/bulk_writer/buffer.py:236:13: PLR1730 [*] Replace `if` statement with `min` call
- pymilvus/orm/iterator.py:54:9: PLR1730 [*] Replace `if` statement with `max` call
+ pymilvus/orm/iterator.py:54:9: PLR1730 [*] Replace `if` statement with `min` call

rotki/rotki (+1 -1 violations, +0 -0 fixes)

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

+ rotkehlchen/exchanges/bybit.py:403:13: PLR1730 [*] Replace `if` statement with `lower_ts = max(lower_ts, start_ts)`
- rotkehlchen/exchanges/bybit.py:403:13: PLR1730 [*] Replace `if` statement with `lower_ts = min(lower_ts, start_ts)`

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1730 14 7 7 0 0

@charliermarsh charliermarsh merged commit e7d1d43 into main Apr 11, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/rev branch April 11, 2024 18:16
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.

PLR1730 min / max reversed detected / auto-fix
1 participant