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

Use function range for no-self-use #8637

Merged
merged 1 commit into from
Nov 12, 2023
Merged

Use function range for no-self-use #8637

merged 1 commit into from
Nov 12, 2023

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Nov 12, 2023

Previously, this rule used the range of the self annotation, but it's a lot more natural to use the range of the function name (since it also means the # noqa is associated with the method rather than its first argument).

Closes #8635.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 12, 2023
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+20763 -20763 violations, +0 -0 fixes in 41 projects)

aiven/aiven-client (+17 -17 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- aiven/client/argx.py:103:26: PLR6301 Method `_get_help_string` could be a function, class method, or static method
+ aiven/client/argx.py:103:9: PLR6301 Method `_get_help_string` could be a function, class method, or static method
- aiven/client/argx.py:298:25: PLR6301 Method `expected_errors` could be a function, class method, or static method
+ aiven/client/argx.py:298:9: PLR6301 Method `expected_errors` could be a function, class method, or static method
+ aiven/client/argx.py:301:9: PLR6301 Method `_to_mapping_collection` could be a function, class method, or static method
- aiven/client/argx.py:302:9: PLR6301 Method `_to_mapping_collection` could be a function, class method, or static method
- aiven/client/cli.py:1012:39: PLR6301 Method `_format_service_notifications` could be a function, class method, or static method
+ aiven/client/cli.py:1012:9: PLR6301 Method `_format_service_notifications` could be a function, class method, or static method
- aiven/client/cli.py:1028:37: PLR6301 Method `print_service_notifications` could be a function, class method, or static method
+ aiven/client/cli.py:1028:9: PLR6301 Method `print_service_notifications` could be a function, class method, or static method
... 24 additional changes omitted for project

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

ruff check --no-cache --exit-zero --select ALL --preview

+ airflow/api/client/local_client.py:31:9: PLR6301 Method `trigger_dag` could be a function, class method, or static method
- airflow/api/client/local_client.py:32:9: PLR6301 Method `trigger_dag` could be a function, class method, or static method
- airflow/api/client/local_client.py:58:20: PLR6301 Method `delete_dag` could be a function, class method, or static method
+ airflow/api/client/local_client.py:58:9: PLR6301 Method `delete_dag` could be a function, class method, or static method
- airflow/api/client/local_client.py:62:18: PLR6301 Method `get_pool` could be a function, class method, or static method
+ airflow/api/client/local_client.py:62:9: PLR6301 Method `get_pool` could be a function, class method, or static method
- airflow/api/client/local_client.py:68:19: PLR6301 Method `get_pools` could be a function, class method, or static method
+ airflow/api/client/local_client.py:68:9: PLR6301 Method `get_pools` could be a function, class method, or static method
- airflow/api/client/local_client.py:71:21: PLR6301 Method `create_pool` could be a function, class method, or static method
+ airflow/api/client/local_client.py:71:9: PLR6301 Method `create_pool` could be a function, class method, or static method
- airflow/api/client/local_client.py:86:21: PLR6301 Method `delete_pool` could be a function, class method, or static method
+ airflow/api/client/local_client.py:86:9: PLR6301 Method `delete_pool` could be a function, class method, or static method
- airflow/api/client/local_client.py:90:21: PLR6301 Method `get_lineage` could be a function, class method, or static method
+ airflow/api/client/local_client.py:90:9: PLR6301 Method `get_lineage` could be a function, class method, or static method
- airflow/api_connexion/schemas/common_schema.py:118:22: PLR6301 Method `get_obj_type` could be a function, class method, or static method
... 12815 additional changes omitted for project

aws/aws-sam-cli (+342 -342 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- samcli/cli/command.py:133:25: PLR6301 Method `format_commands` could be a function, class method, or static method
+ samcli/cli/command.py:133:9: PLR6301 Method `format_commands` could be a function, class method, or static method
- samcli/commands/list/json_consumer.py:14:17: PLR6301 Method `consume` could be a function, class method, or static method
+ samcli/commands/list/json_consumer.py:14:9: PLR6301 Method `consume` could be a function, class method, or static method
- samcli/commands/list/table_consumer.py:15:17: PLR6301 Method `consume` could be a function, class method, or static method
+ samcli/commands/list/table_consumer.py:15:9: PLR6301 Method `consume` could be a function, class method, or static method
- samcli/commands/traces/trace_console_consumers.py:17:17: PLR6301 Method `consume` could be a function, class method, or static method
+ samcli/commands/traces/trace_console_consumers.py:17:9: PLR6301 Method `consume` could be a function, class method, or static method
- samcli/lib/cookiecutter/question.py:133:16: PLR6301 Method `prompt` could be a function, class method, or static method
+ samcli/lib/cookiecutter/question.py:133:9: PLR6301 Method `prompt` could be a function, class method, or static method
... 674 additional changes omitted for project

bokeh/bokeh (+1872 -1872 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --select ALL --preview

- examples/server/app/server_auth/auth.py:34:26: PLR6301 Method `check_permission` could be a function, class method, or static method
+ examples/server/app/server_auth/auth.py:34:9: PLR6301 Method `check_permission` could be a function, class method, or static method
- release/system.py:50:15: PLR6301 Method `abort` could be a function, class method, or static method
+ release/system.py:50:9: PLR6301 Method `abort` could be a function, class method, or static method
- release/system.py:54:12: PLR6301 Method `cd` could be a function, class method, or static method
+ release/system.py:54:9: PLR6301 Method `cd` could be a function, class method, or static method
- src/bokeh/application/handlers/handler.py:198:25: PLR6301 Method `process_request` could be a function, class method, or static method
+ src/bokeh/application/handlers/handler.py:198:9: PLR6301 Method `process_request` could be a function, class method, or static method
- src/bokeh/application/handlers/handler.py:220:18: PLR6301 Method `url_path` could be a function, class method, or static method
+ src/bokeh/application/handlers/handler.py:220:9: PLR6301 Method `url_path` could be a function, class method, or static method
... 3734 additional changes omitted for project

freedomofpress/securedrop (+182 -182 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ admin/securedrop_admin/__init__.py:103:13: PLR6301 Method `validate` could be a function, class method, or static method
- admin/securedrop_admin/__init__.py:103:22: PLR6301 Method `validate` could be a function, class method, or static method
+ admin/securedrop_admin/__init__.py:109:13: PLR6301 Method `validate` could be a function, class method, or static method
- admin/securedrop_admin/__init__.py:109:22: PLR6301 Method `validate` could be a function, class method, or static method
+ admin/securedrop_admin/__init__.py:115:13: PLR6301 Method `validate` could be a function, class method, or static method
- admin/securedrop_admin/__init__.py:115:22: PLR6301 Method `validate` could be a function, class method, or static method
+ admin/securedrop_admin/__init__.py:122:13: PLR6301 Method `validate` could be a function, class method, or static method
- admin/securedrop_admin/__init__.py:122:22: PLR6301 Method `validate` could be a function, class method, or static method
+ admin/securedrop_admin/__init__.py:130:13: PLR6301 Method `validate` could be a function, class method, or static method
- admin/securedrop_admin/__init__.py:130:22: PLR6301 Method `validate` could be a function, class method, or static method
... 354 additional changes omitted for project

fronzbot/blinkpy (+14 -14 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- blinkpy/auth.py:92:16: PLR6301 Method `logout` could be a function, class method, or static method
+ blinkpy/auth.py:92:9: PLR6301 Method `logout` could be a function, class method, or static method
+ blinkpy/sync_module.py:537:15: PLR6301 Method `get_network_info` could be a function, class method, or static method
- blinkpy/sync_module.py:537:32: PLR6301 Method `get_network_info` could be a function, class method, or static method
+ blinkpy/sync_module.py:600:15: PLR6301 Method `get_network_info` could be a function, class method, or static method
- blinkpy/sync_module.py:600:32: PLR6301 Method `get_network_info` could be a function, class method, or static method
+ tests/test_auth.py:277:15: PLR6301 Method `get` could be a function, class method, or static method
- tests/test_auth.py:277:19: PLR6301 Method `get` could be a function, class method, or static method
+ tests/test_auth.py:281:15: PLR6301 Method `post` could be a function, class method, or static method
- tests/test_auth.py:281:20: PLR6301 Method `post` could be a function, class method, or static method
... 18 additional changes omitted for project

ibis-project/ibis (+109 -109 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- docs/_renderer.py:12:16: PLR6301 Method `render` could be a function, class method, or static method
+ docs/_renderer.py:12:9: PLR6301 Method `render` could be a function, class method, or static method
- ibis/backends/base/__init__.py:137:18: PLR6301 Method `_qualify` could be a function, class method, or static method
+ ibis/backends/base/__init__.py:137:9: PLR6301 Method `_qualify` could be a function, class method, or static method
- ibis/backends/base/__init__.py:140:20: PLR6301 Method `_unqualify` could be a function, class method, or static method
+ ibis/backends/base/__init__.py:140:9: PLR6301 Method `_unqualify` could be a function, class method, or static method
+ ibis/backends/base/__init__.py:590:9: PLR6301 Method `to_delta` could be a function, class method, or static method
- ibis/backends/base/__init__.py:591:9: PLR6301 Method `to_delta` could be a function, class method, or static method
- ibis/backends/base/sql/__init__.py:353:14: PLR6301 Method `_log` could be a function, class method, or static method
+ ibis/backends/base/sql/__init__.py:353:9: PLR6301 Method `_log` could be a function, class method, or static method
... 208 additional changes omitted for project

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

ruff check --no-cache --exit-zero --preview

- examples/multithreading_hello_milvus.py:49:21: PLR6301 Method `insert_data` could be a function, class method, or static method
+ examples/multithreading_hello_milvus.py:49:9: PLR6301 Method `insert_data` could be a function, class method, or static method
- pymilvus/bulk_writer/buffer.py:72:16: PLR6301 Method `_throw` could be a function, class method, or static method
+ pymilvus/bulk_writer/buffer.py:72:9: PLR6301 Method `_throw` could be a function, class method, or static method
- pymilvus/bulk_writer/bulk_writer.py:101:16: PLR6301 Method `_throw` could be a function, class method, or static method
+ pymilvus/bulk_writer/bulk_writer.py:101:9: PLR6301 Method `_throw` could be a function, class method, or static method
- pymilvus/bulk_writer/remote_bulk_writer.py:126:19: PLR6301 Method `_local_rm` could be a function, class method, or static method
+ pymilvus/bulk_writer/remote_bulk_writer.py:126:9: PLR6301 Method `_local_rm` could be a function, class method, or static method
+ pymilvus/client/abstract.py:309:9: PLR6301 Method `get_fields_by_range` could be a function, class method, or static method
- pymilvus/client/abstract.py:310:9: PLR6301 Method `get_fields_by_range` could be a function, class method, or static method
... 32 additional changes omitted for project

... Truncated remaining completed projected reports due to GitHub comment length restrictions

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR6301 41526 20763 20763 0 0

@charliermarsh charliermarsh merged commit cbd9157 into main Nov 12, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/self branch November 12, 2023 21:37
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.

Rule PLR6301 ignore comment requires odd location
1 participant