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

[ruff 0.6] Improve the error message for PLW0642 #12866

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

AlexWaygood
Copy link
Member

A followup to #12857, as suggested by @dhruvmanila in #12857 (comment)

@AlexWaygood AlexWaygood merged commit f7b1152 into ruff-0.6 Aug 13, 2024
20 checks passed
@AlexWaygood AlexWaygood deleted the self-assignment-message branch August 13, 2024 16:16
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+407 -653 violations, +0 -0 fixes in 9 projects; 45 projects unchanged)

PlasmaPy/PlasmaPy (+93 -0 violations, +0 -0 fixes)

+ tests/analysis/test_nullpoint.py:241:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
+ tests/analysis/test_nullpoint.py:258:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
+ tests/analysis/test_nullpoint.py:292:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
+ tests/analysis/test_nullpoint.py:311:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
+ tests/analysis/test_nullpoint.py:345:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
+ tests/analysis/test_nullpoint.py:363:1: PT023 [*] Use `@pytest.mark.slow` over `@pytest.mark.slow()`
... 55 additional changes omitted for rule PT023
+ tests/diagnostics/charged_particle_radiography/test_detector_stacks.py:24:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/diagnostics/charged_particle_radiography/test_detector_stacks.py:31:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/diagnostics/test_langmuir.py:144:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/diagnostics/test_langmuir.py:152:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
... 83 additional changes omitted for project

apache/superset (+71 -89 violations, +0 -0 fixes)

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

+ tests/integration_tests/annotation_layers/fixtures.py:69:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
- tests/integration_tests/cachekeys/api_tests.py:37:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
+ tests/integration_tests/charts/api_tests.py:118:5: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/integration_tests/charts/api_tests.py:1273:5: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/integration_tests/charts/api_tests.py:131:5: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/integration_tests/charts/api_tests.py:154:5: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
... 151 additional changes omitted for rule PT001
- tests/integration_tests/charts/data/api_tests.py:142:1: PT023 [*] Use `@pytest.mark.chart_data_flow()` over `@pytest.mark.chart_data_flow`
- tests/integration_tests/charts/data/api_tests.py:992:1: PT023 [*] Use `@pytest.mark.chart_data_flow()` over `@pytest.mark.chart_data_flow`
- tests/integration_tests/import_export_tests.py:523:5: PT023 [*] Use `@pytest.mark.skip()` over `@pytest.mark.skip`
- tests/integration_tests/sqllab_tests.py:70:1: PT023 [*] Use `@pytest.mark.sql_json_flow()` over `@pytest.mark.sql_json_flow`
... 150 additional changes omitted for project

bokeh/bokeh (+4 -143 violations, +0 -0 fixes)

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

- src/bokeh/events.py:182:9: PLW0642 Confusing assignment to `cls` argument in class method
+ src/bokeh/events.py:182:9: PLW0642 Reassigned `cls` variable in class method
- tests/integration/embed/test_json_item.py:57:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
- tests/integration/models/test_datarange1d.py:53:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
- tests/integration/models/test_plot.py:57:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
- tests/integration/models/test_sources.py:51:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
- tests/integration/test_regressions.py:32:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
- tests/integration/tools/test_box_edit_tool.py:81:1: PT023 [*] Use `@pytest.mark.selenium()` over `@pytest.mark.selenium`
... 114 additional changes omitted for rule PT023
- tests/support/plugins/ipython.py:44:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- tests/support/plugins/managed_server_loop.py:59:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
... 137 additional changes omitted for project

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

+ admin/tests/test_integration.py:534:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ molecule/testinfra/app-code/test_securedrop_app_code.py:55:1: PT023 [*] Use `@pytest.mark.skip_in_prod` over `@pytest.mark.skip_in_prod()`
+ molecule/testinfra/app-code/test_securedrop_app_code.py:69:1: PT023 [*] Use `@pytest.mark.skip_in_prod` over `@pytest.mark.skip_in_prod()`
+ molecule/testinfra/app/test_app_network.py:12:1: PT023 [*] Use `@pytest.mark.skip_in_prod` over `@pytest.mark.skip_in_prod()`
+ molecule/testinfra/app/test_appenv.py:18:1: PT023 [*] Use `@pytest.mark.skip_in_prod` over `@pytest.mark.skip_in_prod()`
+ molecule/testinfra/app/test_appenv.py:90:1: PT023 [*] Use `@pytest.mark.skip_in_prod` over `@pytest.mark.skip_in_prod()`
+ molecule/testinfra/app/test_ossec_agent.py:42:1: PT023 [*] Use `@pytest.mark.xfail` over `@pytest.mark.xfail()`
... 23 additional changes omitted for rule PT023
+ securedrop/tests/conftest.py:102:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ securedrop/tests/conftest.py:122:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ securedrop/tests/conftest.py:151:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
... 43 additional changes omitted for project

pandas-dev/pandas (+51 -51 violations, +0 -0 fixes)

- pandas/core/arrays/categorical.py:572:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/categorical.py:572:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1065:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1065:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1080:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1080:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1081:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1081:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1109:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1109:9: PLW0642 Reassigned `self` variable in instance method
... 92 additional changes omitted for project

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

+ test/conftest.py:40:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ test/conftest.py:49:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ unit_test/conftest.py:22:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ unit_test/main_tests/conftest.py:63:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ unit_test/main_tests/conftest.py:84:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ unit_test/option_prepare_test.py:32:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`

rotki/rotki (+0 -370 violations, +0 -0 fixes)

- rotkehlchen/tests/api/blockchain/test_substrate.py:102:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/blockchain/test_substrate.py:51:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_caching.py:116:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_current_assets_price.py:311:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_current_assets_price.py:345:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_history_events_export.py:83:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_makerdao_vaults.py:890:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_metadata.py:14:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
- rotkehlchen/tests/api/test_nfts.py:135:1: PT023 [*] Use `@pytest.mark.vcr()` over `@pytest.mark.vcr`
... 334 additional changes omitted for rule PT023
- rotkehlchen/tests/conftest.py:107:5: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/accounting.py:73:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/accounting.py:85:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/db.py:125:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/exchanges/binance.py:12:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/exchanges/bitcoinde.py:6:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/exchanges/bitfinex.py:17:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
- rotkehlchen/tests/fixtures/exchanges/bitmex.py:11:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture`
... 353 additional changes omitted for project

scikit-build/scikit-build (+20 -0 violations, +0 -0 fixes)

+ tests/conftest.py:150:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/conftest.py:157:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()`
+ tests/test_distribution.py:12:1: PT023 [*] Use `@pytest.mark.isolated` over `@pytest.mark.isolated()`
+ tests/test_distribution.py:29:1: PT023 [*] Use `@pytest.mark.isolated` over `@pytest.mark.isolated()`
+ tests/test_hello_cpp.py:174:1: PT023 [*] Use `@pytest.mark.deprecated` over `@pytest.mark.deprecated()`
+ tests/test_hello_fortran.py:22:1: PT023 [*] Use `@pytest.mark.fortran` over `@pytest.mark.fortran()`
+ tests/test_hello_fortran.py:30:1: PT023 [*] Use `@pytest.mark.fortran` over `@pytest.mark.fortran()`
+ tests/test_hello_fortran.py:61:1: PT023 [*] Use `@pytest.mark.fortran` over `@pytest.mark.fortran()`
... 13 additional changes omitted for rule PT023
... 12 additional changes omitted for project

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

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
PT023 661 196 465 0 0
PT001 295 159 136 0 0
PLW0642 104 52 52 0 0

Linter (preview)

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

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

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

- src/bokeh/events.py:182:9: PLW0642 Confusing assignment to `cls` argument in class method
+ src/bokeh/events.py:182:9: PLW0642 Reassigned `cls` variable in class method

pandas-dev/pandas (+51 -51 violations, +0 -0 fixes)

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

- pandas/core/arrays/categorical.py:572:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/categorical.py:572:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1065:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1065:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1080:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1080:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1081:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1081:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1109:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1109:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1118:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1118:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1129:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1129:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1131:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1131:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1136:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1136:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1185:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1185:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1187:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1187:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1203:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1203:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1260:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1260:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1274:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1274:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1480:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1480:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:1699:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:1699:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:2131:17: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:2131:17: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:2153:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:2153:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:456:17: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:456:17: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:778:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:778:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/arrays/datetimelike.py:979:13: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/arrays/datetimelike.py:979:13: PLW0642 Reassigned `self` variable in instance method
- pandas/core/frame.py:7827:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/frame.py:7827:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/frame.py:7840:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/frame.py:7840:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/frame.py:8183:9: PLW0642 Confusing assignment to `self` argument in instance method
+ pandas/core/frame.py:8183:9: PLW0642 Reassigned `self` variable in instance method
- pandas/core/frame.py:8195:21: PLW0642 Confusing assignment to `self` argument in instance method
... 53 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLW0642 104 52 52 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants