Skip to content

Ignore unused arguments on stub functions#12966

Merged
charliermarsh merged 1 commit intomainfrom
charlie/stu
Aug 18, 2024
Merged

Ignore unused arguments on stub functions#12966
charliermarsh merged 1 commit intomainfrom
charlie/stu

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Aug 18, 2024

Summary

We already enforce this logic for the other ARG rules. I'm guessing this was an oversight.

Closes #12963.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Aug 18, 2024
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 18, 2024

CodSpeed Performance Report

Merging #12966 will degrade performances by 5.17%

Comparing charlie/stu (ce7df06) with main (4881d32)

Summary

❌ 1 regressions
✅ 31 untouched benchmarks

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

Benchmarks breakdown

Benchmark main charlie/stu Change
linter/all-rules[numpy/globals.py] 727 µs 766.6 µs -5.17%

@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

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

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

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

- airflow/listeners/spec/dagrun.py:31:24: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:31:41: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dagrun.py:36:24: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:36:41: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dagrun.py:41:23: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:41:40: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dataset.py:32:5: ARG001 Unused function argument: `dataset`
- airflow/listeners/spec/dataset.py:39:5: ARG001 Unused function argument: `dataset`
- airflow/listeners/spec/importerrors.py:26:29: ARG001 Unused function argument: `filename`
- airflow/listeners/spec/importerrors.py:26:39: ARG001 Unused function argument: `stacktrace`
- airflow/listeners/spec/importerrors.py:31:34: ARG001 Unused function argument: `filename`
- airflow/listeners/spec/importerrors.py:31:44: ARG001 Unused function argument: `stacktrace`
- airflow/listeners/spec/lifecycle.py:26:17: ARG001 Unused function argument: `component`
- airflow/listeners/spec/lifecycle.py:37:21: ARG001 Unused function argument: `component`
- airflow/listeners/spec/taskinstance.py:35:47: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:35:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:35:76: ARG001 Unused function argument: `session`
- airflow/listeners/spec/taskinstance.py:42:47: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:42:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:42:76: ARG001 Unused function argument: `session`
- airflow/listeners/spec/taskinstance.py:49:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:50:5: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:51:5: ARG001 Unused function argument: `error`
- airflow/listeners/spec/taskinstance.py:52:5: ARG001 Unused function argument: `session`
- airflow/policies.py:109:31: ARG001 Unused function argument: `dag_file_path`
- airflow/policies.py:36:17: ARG001 Unused function argument: `task`
- airflow/policies.py:54:16: ARG001 Unused function argument: `dag`
- airflow/policies.py:72:33: ARG001 Unused function argument: `task_instance`
- airflow/policies.py:83:23: ARG001 Unused function argument: `pod`
- airflow/policies.py:96:30: ARG001 Unused function argument: `context`
... 147 additional changes omitted for project

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

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

- tests/integration_tests/advanced_data_type/api_tests.py:56:27: ARG001 Unused function argument: `col`
- tests/integration_tests/advanced_data_type/api_tests.py:56:40: ARG001 Unused function argument: `op`
- tests/integration_tests/advanced_data_type/api_tests.py:56:60: ARG001 Unused function argument: `values`

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

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

- release/credentials.py:75:29: ARG001 Unused function argument: `config`
- release/credentials.py:75:45: ARG001 Unused function argument: `system`
- release/credentials.py:75:64: ARG001 Unused function argument: `token`
- release/credentials.py:82:31: ARG001 Unused function argument: `config`
- release/credentials.py:82:47: ARG001 Unused function argument: `system`
- release/credentials.py:82:66: ARG001 Unused function argument: `token`
- src/bokeh/application/handlers/lifecycle.py:135:17: ARG001 Unused function argument: `ignored`
- src/bokeh/core/has_props.py:49:19: ARG001 Unused function argument: `arg`
- src/bokeh/sphinxext/example_handler.py:85:20: ARG001 Unused function argument: `args`
- src/bokeh/sphinxext/example_handler.py:85:28: ARG001 Unused function argument: `kw`
- src/bokeh/util/terminal.py:72:12: ARG001 Unused function argument: `values`
- src/bokeh/util/terminal.py:72:27: ARG001 Unused function argument: `kwargs`
- tests/unit/bokeh/application/handlers/test_document_lifecycle.py:57:21: ARG001 Unused function argument: `a`
... 64 additional changes omitted for project

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

+ unit_test/main_tests/conftest.py:50:50: RUF100 [*] Unused `noqa` directive (unused: `ARG001`)

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

+ tests/test_get_requires.py:23:64: RUF100 [*] Unused `noqa` directive (unused: `ARG001`)

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

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

- zerver/lib/markdown/__init__.py:419:22: ARG001 Unused function argument: `tweet_id`
- zerver/lib/partial.py:36:17: ARG001 Unused function argument: `func`
- zerver/lib/partial.py:36:45: ARG001 Unused function argument: `args`
- zerver/lib/push_notifications.py:179:47: ARG001 Unused function argument: `result`
- zerver/lib/push_notifications.py:179:9: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:319:13: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:321:13: ARG001 Unused function argument: `path_var_default`
- zerver/tests/test_typed_endpoint.py:331:13: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:333:13: ARG001 Unused function argument: `foo`
- zerver/tests/test_typed_endpoint.py:337:13: ARG001 Unused function argument: `bar`
... 22 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
ARG001 289 0 289 0 0
RUF100 2 2 0 0 0

Linter (preview)

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

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

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

- airflow/listeners/spec/dagrun.py:31:24: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:31:41: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dagrun.py:36:24: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:36:41: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dagrun.py:41:23: ARG001 Unused function argument: `dag_run`
- airflow/listeners/spec/dagrun.py:41:40: ARG001 Unused function argument: `msg`
- airflow/listeners/spec/dataset.py:32:5: ARG001 Unused function argument: `dataset`
- airflow/listeners/spec/dataset.py:39:5: ARG001 Unused function argument: `dataset`
- airflow/listeners/spec/importerrors.py:26:29: ARG001 Unused function argument: `filename`
- airflow/listeners/spec/importerrors.py:26:39: ARG001 Unused function argument: `stacktrace`
- airflow/listeners/spec/importerrors.py:31:34: ARG001 Unused function argument: `filename`
- airflow/listeners/spec/importerrors.py:31:44: ARG001 Unused function argument: `stacktrace`
- airflow/listeners/spec/lifecycle.py:26:17: ARG001 Unused function argument: `component`
- airflow/listeners/spec/lifecycle.py:37:21: ARG001 Unused function argument: `component`
- airflow/listeners/spec/taskinstance.py:35:47: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:35:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:35:76: ARG001 Unused function argument: `session`
- airflow/listeners/spec/taskinstance.py:42:47: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:42:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:42:76: ARG001 Unused function argument: `session`
- airflow/listeners/spec/taskinstance.py:49:5: ARG001 Unused function argument: `previous_state`
- airflow/listeners/spec/taskinstance.py:50:5: ARG001 Unused function argument: `task_instance`
- airflow/listeners/spec/taskinstance.py:51:5: ARG001 Unused function argument: `error`
- airflow/listeners/spec/taskinstance.py:52:5: ARG001 Unused function argument: `session`
- airflow/policies.py:109:31: ARG001 Unused function argument: `dag_file_path`
- airflow/policies.py:36:17: ARG001 Unused function argument: `task`
- airflow/policies.py:54:16: ARG001 Unused function argument: `dag`
- airflow/policies.py:72:33: ARG001 Unused function argument: `task_instance`
- airflow/policies.py:83:23: ARG001 Unused function argument: `pod`
- airflow/policies.py:96:30: ARG001 Unused function argument: `context`
... 147 additional changes omitted for project

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

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

- tests/integration_tests/advanced_data_type/api_tests.py:56:27: ARG001 Unused function argument: `col`
- tests/integration_tests/advanced_data_type/api_tests.py:56:40: ARG001 Unused function argument: `op`
- tests/integration_tests/advanced_data_type/api_tests.py:56:60: ARG001 Unused function argument: `values`

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

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

- release/credentials.py:75:29: ARG001 Unused function argument: `config`
- release/credentials.py:75:45: ARG001 Unused function argument: `system`
- release/credentials.py:75:64: ARG001 Unused function argument: `token`
- release/credentials.py:82:31: ARG001 Unused function argument: `config`
- release/credentials.py:82:47: ARG001 Unused function argument: `system`
- release/credentials.py:82:66: ARG001 Unused function argument: `token`
- src/bokeh/application/handlers/lifecycle.py:135:17: ARG001 Unused function argument: `ignored`
- src/bokeh/core/has_props.py:49:19: ARG001 Unused function argument: `arg`
- src/bokeh/sphinxext/example_handler.py:85:20: ARG001 Unused function argument: `args`
- src/bokeh/sphinxext/example_handler.py:85:28: ARG001 Unused function argument: `kw`
- src/bokeh/util/terminal.py:72:12: ARG001 Unused function argument: `values`
- src/bokeh/util/terminal.py:72:27: ARG001 Unused function argument: `kwargs`
- tests/unit/bokeh/application/handlers/test_document_lifecycle.py:57:21: ARG001 Unused function argument: `a`
... 64 additional changes omitted for project

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

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

+ unit_test/main_tests/conftest.py:50:50: RUF100 [*] Unused `noqa` directive (unused: `ARG001`)

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

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

+ tests/test_get_requires.py:23:64: RUF100 [*] Unused `noqa` directive (unused: `ARG001`)

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

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

- zerver/lib/markdown/__init__.py:419:22: ARG001 Unused function argument: `tweet_id`
- zerver/lib/partial.py:36:17: ARG001 Unused function argument: `func`
- zerver/lib/partial.py:36:45: ARG001 Unused function argument: `args`
- zerver/lib/push_notifications.py:179:47: ARG001 Unused function argument: `result`
- zerver/lib/push_notifications.py:179:9: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:319:13: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:321:13: ARG001 Unused function argument: `path_var_default`
- zerver/tests/test_typed_endpoint.py:331:13: ARG001 Unused function argument: `request`
- zerver/tests/test_typed_endpoint.py:333:13: ARG001 Unused function argument: `foo`
- zerver/tests/test_typed_endpoint.py:337:13: ARG001 Unused function argument: `bar`
... 22 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
ARG001 289 0 289 0 0
RUF100 2 2 0 0 0

@charliermarsh charliermarsh merged commit 80ade59 into main Aug 18, 2024
@charliermarsh charliermarsh deleted the charlie/stu branch August 18, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Disable unused args check for stub functions

1 participant