Skip to content

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Mar 12, 2025

Summary

This PR stabilizes the fixes improvements made in #15562 (released with ruff 0.9.3 in mid January).

There's no open issue or PR related to the changed fix behavior.

This is not a breaking change. The fix was only gated behind preview to get some more test coverage before releasing.

@MichaReiser MichaReiser added the fixes Related to suggested fixes for violations label Mar 12, 2025
@MichaReiser MichaReiser added this to the v0.10 milestone Mar 12, 2025
@MichaReiser MichaReiser force-pushed the micha/sim103-fix-improvements branch from 4c94b78 to fec9aa3 Compare March 12, 2025 16:15
@MichaReiser MichaReiser changed the title [flake8-simplify] Avoid double negation in proposed fixes (SIM103) [flake8-simplify] Avoid double negation i fixes (SIM103) Mar 12, 2025
@MichaReiser MichaReiser changed the title [flake8-simplify] Avoid double negation i fixes (SIM103) [flake8-simplify] Avoid double negation in fixes (SIM103) Mar 12, 2025
@MichaReiser MichaReiser requested a review from ntBre March 12, 2025 16:17
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 12, 2025

CodSpeed Performance Report

Merging #16684 will degrade performances by 4.61%

Comparing micha/sim103-fix-improvements (fec9aa3) with micha/ruff-0.10 (464ea4a)

Summary

❌ 1 regressions
✅ 31 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
red_knot_check_file[incremental] 5.2 ms 5.5 ms -4.61%

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+13 -13 violations, +0 -0 fixes in 4 projects; 51 projects unchanged)

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

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

- airflow/configuration.py:1278:13: SIM103 Return the condition `not value is None` directly
+ airflow/configuration.py:1278:13: SIM103 Return the condition `value is not None` directly
+ kubernetes_tests/test_base.py:349:9: SIM103 Return the condition `"(no change)" not in patch_configmap_result` directly
- kubernetes_tests/test_base.py:349:9: SIM103 Return the condition `not "(no change)" in patch_configmap_result` directly
- providers/amazon/src/airflow/providers/amazon/aws/sensors/athena.py:94:9: SIM103 Return the condition `not state in self.INTERMEDIATE_STATES` directly
+ providers/amazon/src/airflow/providers/amazon/aws/sensors/athena.py:94:9: SIM103 Return the condition `state not in self.INTERMEDIATE_STATES` directly
- providers/amazon/src/airflow/providers/amazon/aws/sensors/emr.py:316:9: SIM103 Return the condition `not state in self.INTERMEDIATE_STATES` directly
+ providers/amazon/src/airflow/providers/amazon/aws/sensors/emr.py:316:9: SIM103 Return the condition `state not in self.INTERMEDIATE_STATES` directly
- providers/amazon/src/airflow/providers/amazon/aws/sensors/opensearch_serverless.py:110:9: SIM103 Return the condition `not state in self.INTERMEDIATE_STATES` directly
+ providers/amazon/src/airflow/providers/amazon/aws/sensors/opensearch_serverless.py:110:9: SIM103 Return the condition `state not in self.INTERMEDIATE_STATES` directly
+ scripts/ci/pre_commit/check_integrations_list.py:113:9: SIM103 Return the condition `j not in ["Description", "Identifier"]` directly
- scripts/ci/pre_commit/check_integrations_list.py:113:9: SIM103 Return the condition `not j in ["Description", "Identifier"]` directly

apache/superset (+1 -1 violations, +0 -0 fixes)

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

- superset/commands/importers/v1/utils.py:204:5: SIM103 Return the condition `not path.suffix.lower() not in {".yaml", ".yml"}` directly
+ superset/commands/importers/v1/utils.py:204:5: SIM103 Return the condition `path.suffix.lower() in {".yaml", ".yml"}` directly

binary-husky/gpt_academic (+4 -4 violations, +0 -0 fixes)

+ request_llms/bridge_skylark2.py:9:5: SIM103 Return the condition `YUNQUE_SECRET_KEY != ''` directly
- request_llms/bridge_skylark2.py:9:5: SIM103 Return the condition `not YUNQUE_SECRET_KEY == ''` directly
+ request_llms/bridge_taichu.py:12:5: SIM103 Return the condition `TAICHU_API_KEY != ''` directly
- request_llms/bridge_taichu.py:12:5: SIM103 Return the condition `not TAICHU_API_KEY == ''` directly
+ request_llms/bridge_zhipu.py:12:5: SIM103 Return the condition `ZHIPUAI_API_KEY != ''` directly
- request_llms/bridge_zhipu.py:12:5: SIM103 Return the condition `not ZHIPUAI_API_KEY == ''` directly
+ request_llms/com_qwenapi.py:16:13: SIM103 Return the condition `DASHSCOPE_API_KEY != ''` directly
- request_llms/com_qwenapi.py:16:13: SIM103 Return the condition `not DASHSCOPE_API_KEY == ''` directly

zulip/zulip (+2 -2 violations, +0 -0 fixes)

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

- zerver/lib/message.py:1683:5: SIM103 Return the condition `not user_profile.realm != message.get_realm()` directly
+ zerver/lib/message.py:1683:5: SIM103 Return the condition `user_profile.realm == message.get_realm()` directly
+ zerver/views/custom_profile_fields.py:82:5: SIM103 Return the condition `field_data["subtype"] != "custom"` directly
- zerver/views/custom_profile_fields.py:82:5: SIM103 Return the condition `not field_data["subtype"] == "custom"` directly

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
SIM103 26 13 13 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Nice, this looks like a much better fix

@MichaReiser MichaReiser merged commit 7966279 into micha/ruff-0.10 Mar 13, 2025
20 of 21 checks passed
@MichaReiser MichaReiser deleted the micha/sim103-fix-improvements branch March 13, 2025 07:45
@MichaReiser MichaReiser mentioned this pull request Mar 13, 2025
2 tasks
MichaReiser added a commit that referenced this pull request Mar 13, 2025
## Summary

This PR stabilizes the fixes improvements made in
#15562 (released with ruff 0.9.3
in mid January).

There's no open issue or PR related to the changed fix behavior.

This is not a breaking change. The fix was only gated behind preview to
get some more test coverage before releasing.
MichaReiser added a commit that referenced this pull request Mar 13, 2025
## Summary

This PR stabilizes the fixes improvements made in
#15562 (released with ruff 0.9.3
in mid January).

There's no open issue or PR related to the changed fix behavior.

This is not a breaking change. The fix was only gated behind preview to
get some more test coverage before releasing.
dcreager added a commit that referenced this pull request Mar 14, 2025
* main: (53 commits)
  [syntax-errors] Tuple unpacking in `for` statement iterator clause before Python 3.9 (#16558)
  Ruff v0.10 Release (#16708)
  Add new `noqa` specification to the docs (#16703)
  describe requires-python fallback in docs (#16704)
  [red-knot] handle cycles in MRO/bases resolution (#16693)
  [red-knot] Auto generate statement nodes (#16645)
  [`pylint`] Better inference for `str.strip` (`PLE310`) (#16671)
  [`pylint`] Improve `repeated-equality-comparison` fix to use a `set` when all elements are hashable (`PLR1714`) (#16685)
  [`pylint`/`pep8-naming`] Check `__new__` argument name in `bad-staticmethod-argument` and not `invalid-first-argument-name-for-class-method` (`PLW0211`/`N804`) (#16676)
  [`flake8-pyi`] Stabilize fix for `unused-private-type-var` (`PYI018`) (#16682)
  [`flake8-bandit`] Deprecate `suspicious-xmle-tree-usage` (`S320`) (#16680)
  [`flake8-simplify`] Avoid double negation in fixes (`SIM103`) (#16684)
  [`pyupgrade`]: Improve diagnostic range for `redundant-open-mode` (`UP015`) (#16672)
  Consider all `TYPE_CHECKING` symbols for type-checking blocks (#16669)
  [`pep8-naming`]: Ignore methods decorated with `@typing.override` (`invalid-argument-name`) (#16667)
  Stabilize FURB169 preview behavior (#16666)
  [`pylint`] Detect invalid default value type for `os.environ.get` (`PLW1508`) (#16674)
  [`flake8-pytest-style`] Allow for loops with empty bodies (`PT012`, `PT031`) (#16678)
  [`pyupgrade`]: Deprecate `non-pep604-isinstance` (`UP038`) (#16681)
  [`flake8-type-checking`] Stabilize `runtime-cast-value` (`TC006`) (#16637)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants