-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove 'non-obvious' allowance for E721 #12300
Conversation
73317a1
to
d530aac
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
E721 | 92 | 92 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+92 -0 violations, +0 -0 fixes in 18 projects; 36 projects unchanged)
RasaHQ/rasa (+6 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ rasa/shared/core/training_data/structures.py:242:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + rasa/shared/core/training_data/structures.py:248:13: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + rasa/shared/core/training_data/structures.py:258:13: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + rasa/validator.py:134:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/shared/core/test_slots.py:90:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/utils/tensorflow/test_models.py:51:20: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
alteryx/featuretools (+6 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ featuretools/computational_backends/feature_set_calculator.py:457:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + featuretools/computational_backends/feature_set_calculator.py:459:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + featuretools/computational_backends/feature_set_calculator.py:461:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + featuretools/computational_backends/feature_set_calculator.py:463:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + featuretools/computational_backends/feature_set_calculator.py:465:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + featuretools/tests/computational_backend/test_calculate_feature_matrix.py:190:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
PlasmaPy/PlasmaPy (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/plasmapy/diagnostics/thomson.py:564:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + src/plasmapy/diagnostics/thomson.py:969:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/particles/test_factory.py:55:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
apache/airflow (+13 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ airflow/models/dag.py:861:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + airflow/models/expandinput.py:295:62: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + airflow/models/xcom_arg.py:728:57: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + airflow/ti_deps/deps/task_not_running_dep.py:35:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + airflow/utils/log/file_task_handler.py:196:34: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/datasets/test_dataset.py:354:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/decorators/test_task_group.py:114:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/providers/amazon/aws/deferrable/hooks/test_base_aws.py:37:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/providers/asana/hooks/test_asana.py:44:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/providers/cncf/kubernetes/utils/test_pod_manager.py:128:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks ... 3 additional changes omitted for project
apache/superset (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ tests/integration_tests/sqla_models_tests.py:919:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
bokeh/bokeh (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ tests/unit/bokeh/models/test_sources.py:476:20: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
freedomofpress/securedrop (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ admin/tests/test_securedrop-admin.py:850:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + admin/tests/test_securedrop-admin.py:938:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + admin/tests/test_securedrop-admin.py:965:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
ibis-project/ibis (+19 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ ibis/backends/bigquery/tests/unit/udf/test_find.py:20:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/bigquery/udf/rewrite.py:13:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/impala/tests/test_udf.py:147:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/impala/tests/test_udf.py:150:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/impala/tests/test_udf.py:187:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/impala/tests/test_udf.py:189:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/impala/tests/test_udf.py:385:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/backends/pyspark/__init__.py:89:29: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/common/tests/test_collections.py:249:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + ibis/common/tests/test_patterns.py:1164:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks ... 9 additional changes omitted for project
langchain-ai/langchain (+8 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ libs/community/tests/integration_tests/agent/test_ainetwork_agent.py:41:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/community/tests/integration_tests/llms/utils.py:9:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/core/langchain_core/tracers/log_stream.py:105:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/core/langchain_core/tracers/log_stream.py:135:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/core/tests/unit_tests/output_parsers/test_pydantic_parser.py:51:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/partners/groq/tests/integration_tests/test_chat_models.py:391:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/partners/groq/tests/unit_tests/test_chat_models.py:176:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + libs/partners/groq/tests/unit_tests/test_chat_models.py:198:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
prefecthq/prefect (+16 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/prefect/results.py:438:49: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + src/prefect/serializers.py:79:49: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + src/prefect/testing/utilities.py:35:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + src/prefect/utilities/annotations.py:25:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + src/prefect/utilities/pydantic.py:176:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/blocks/test_core.py:2281:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/blocks/test_core.py:2284:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/blocks/test_core.py:2288:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/blocks/test_core.py:2291:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + tests/blocks/test_core.py:2295:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks ... 6 additional changes omitted for project
pypa/pip (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/pip/_internal/utils/misc.py:559:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
pypa/setuptools (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ pkg_resources/tests/test_pkg_resources.py:282:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + setuptools/command/editable_wheel.py:302:39: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
python/mypy (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ mypy/meet.py:580:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + mypy/messages.py:527:21: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + mypy/test/helpers.py:332:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
qdrant/qdrant-client (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ tests/congruence_tests/test_common.py:197:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
... Truncated remaining completed project reports due to GitHub comment length restrictions
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
E721 | 92 | 92 | 0 | 0 | 0 |
This should arguably be in preview, but it's also arguably a bug fix. I would say it should go out in stable personally. |
Yeah, I think it's fine to release this in stable. Also, quoting from the versioning policy:
|
https://docs.astral.sh/ruff/rules/type-comparison/ This wasn't caught previously due to bug in Ruff: astral-sh/ruff#12300
Summary
I don't fully understand the purpose of this. In #7905, it was just copied over from the previous non-preview implementation. But it means that (e.g.) we don't treat
type(self.foo)
as a type -- which is wrong.Closes #12290.