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

[flake8-pyi] - include all python file types for PYI006 and PYI066 #14059

Merged

Conversation

diceroll123
Copy link
Contributor

Summary

Allows bad-version-info-order and bad-version-info-comparison to work in file types besides stubs

Closes #13836

Test Plan

cargo test

I really only just moved code around and updated snapshots

Copy link
Contributor

github-actions bot commented Nov 2, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+42 -0 violations, +0 -0 fixes in 6 projects; 48 projects unchanged)

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

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

+ providers/src/airflow/providers/cloudant/hooks/cloudant.py:25:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ providers/tests/cloudant/hooks/test_cloudant.py:30:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ providers/tests/google/cloud/utils/test_mlengine_prediction_summary.py:27:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/plugins/test_plugins_manager.py:65:12: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons

pypa/cibuildwheel (+2 -0 violations, +0 -0 fixes)

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

+ bin/bump_version.py:20:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ cibuildwheel/_compat/typing.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons

pypa/setuptools (+4 -0 violations, +0 -0 fixes)

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

+ setuptools/_importlib.py:3:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ setuptools/_importlib.py:9:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ setuptools/command/bdist_wheel.py:493:20: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ setuptools/tests/test_bdist_wheel.py:524:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons

scikit-build/scikit-build-core (+19 -0 violations, +0 -0 fixes)

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

+ docs/conf.py:16:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/builtins.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/importlib/metadata.py:15:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/importlib/metadata.py:17:10: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/importlib/metadata.py:6:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/importlib/resources.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/tomllib.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/typing.py:14:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/typing.py:19:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_compat/typing.py:6:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/_logging.py:80:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/builder/sysconfig.py:179:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/file_api/reply.py:76:24: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/scikit_build_core/settings/json_schema.py:67:16: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/conftest.py:16:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/conftest.py:23:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/packages/navigate_editable/python/shared_pkg/py_module.py:3:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/test_builder.py:247:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ tests/test_pyproject_pep660.py:100:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons

python-trio/trio (+7 -0 violations, +0 -0 fixes)

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

+ src/trio/_core/_tests/test_run.py:2783:4: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:110:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:51:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:57:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:60:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:78:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ src/trio/_tests/type_tests/path.py:98:8: PYI006 Use `<` or `>=` for `sys.version_info` comparisons

pytest-dev/pytest (+6 -0 violations, +0 -0 fixes)

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

+ src/_pytest/_code/code.py:699:16: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/_pytest/assertion/rewrite.py:299:16: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ src/_pytest/pathlib.py:41:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ testing/_py/test_local.py:21:12: PYI006 Use `<` or `>=` for `sys.version_info` comparisons
+ testing/code/test_excinfo.py:1771:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
+ testing/test_debugging.py:106:12: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PYI066 34 34 0 0 0
PYI006 8 8 0 0 0

@charliermarsh
Copy link
Member

Thanks! We probably need to gate this under preview, since it's an expansion of the rule.

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Nov 3, 2024
@MichaReiser MichaReiser merged commit f69712c into astral-sh:main Nov 3, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bad-version-info-comparison (PYI006) doesn't run in .py files
3 participants