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

Remove unreachable-code feature #9463

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Remove unreachable-code feature #9463

merged 1 commit into from
Jan 12, 2024

Conversation

charliermarsh
Copy link
Member

Summary

We haven't found time to flip this on, so feels like it's best to remove it for now -- can always restore from source when we get back to it.

@charliermarsh charliermarsh added the internal An internal refactor or improvement label Jan 11, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+8985 -143 violations, +0 -0 fixes in 10 projects; 33 projects unchanged)

DisnakeDev/disnake (+1 -11 violations, +0 -0 fixes)

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

+ disnake/ext/tasks/__init__.py:278:14: RUF021 [*] Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
- disnake/state.py:2244:9: RUF014 Unreachable code in _delay_ready
- disnake/state.py:2249:13: RUF014 Unreachable code in _delay_ready
- disnake/state.py:2252:17: RUF014 Unreachable code in _delay_ready
- disnake/state.py:2256:13: RUF014 Unreachable code in _delay_ready
- disnake/state.py:2266:13: RUF014 Unreachable code in _delay_ready
- disnake/state.py:2267:17: RUF014 Unreachable code in _delay_ready
... 6 additional changes omitted for rule RUF014
... 5 additional changes omitted for project

RasaHQ/rasa (+22 -4 violations, +0 -0 fixes)

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

+ rasa/core/brokers/kafka.py:27:9: D417 Missing argument description in the docstring for `__init__`: `**kwargs`
+ rasa/core/evaluation/marker_base.py:894:9: D417 Missing argument description in the docstring for `from_tag_and_sub_config`: `description`
- rasa/core/lock_store.py:140:9: RUF014 Unreachable code in _acquire_lock
- rasa/core/tracker_store.py:1116:9: RUF014 Unreachable code in __init__
+ rasa/shared/core/domain.py:727:9: D417 Missing argument description in the docstring for `__init__`: `**kwargs`
- rasa/utils/tensorflow/models.py:340:9: RUF014 Unreachable code in run_inference
+ scripts/release.py:112:5: D202 [*] No blank lines allowed after function docstring (found 1)
+ scripts/release.py:174:5: D202 [*] No blank lines allowed after function docstring (found 1)
+ scripts/release.py:189:5: D202 [*] No blank lines allowed after function docstring (found 1)
+ scripts/release.py:208:5: D202 [*] No blank lines allowed after function docstring (found 1)
... 16 additional changes omitted for project

apache/airflow (+7045 -45 violations, +0 -0 fixes)

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

+ airflow/cli/commands/dag_command.py:123:17: T201 `print` found
+ airflow/cli/commands/dag_command.py:129:18: ANN001 Missing type annotation for function argument `args`
+ airflow/cli/commands/dag_command.py:133:5: B028 No explicit `stacklevel` keyword argument found
+ airflow/cli/commands/dag_command.py:142:15: TRY003 Avoid specifying long messages outside the exception class
+ airflow/cli/commands/dag_command.py:142:32: EM101 Exception must not use a string literal, assign to variable first
+ airflow/cli/commands/dag_command.py:160:17: ANN001 Missing type annotation for function argument `args`
+ airflow/cli/commands/dag_command.py:176:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
+ airflow/cli/commands/dag_command.py:176:9: TRY200 Use `raise from` to specify exception cause
+ airflow/cli/commands/dag_command.py:181:16: ANN001 Missing type annotation for function argument `args`
+ airflow/cli/commands/dag_command.py:191:13: T201 `print` found
+ airflow/cli/commands/dag_command.py:193:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
+ airflow/cli/commands/dag_command.py:193:13: TRY200 Use `raise from` to specify exception cause
+ airflow/cli/commands/dag_command.py:195:9: T201 `print` found
+ airflow/cli/commands/dag_command.py:1:1: CPY001 Missing copyright notice at top of file
+ airflow/cli/commands/dag_command.py:200:15: ANN001 Missing type annotation for function argument `args`
+ airflow/cli/commands/dag_command.py:202:19: FBT003 Boolean positional value in function call
+ airflow/cli/commands/dag_command.py:207:17: ANN001 Missing type annotation for function argument `args`
+ airflow/cli/commands/dag_command.py:209:19: FBT003 Boolean positional value in function call
+ airflow/cli/commands/dag_command.py:213:19: FBT001 Boolean-typed positional argument in function definition
+ airflow/cli/commands/dag_command.py:213:36: ANN001 Missing type annotation for function argument `args`
... 816 additional changes omitted for rule ANN001
+ airflow/cli/commands/dag_command.py:218:15: TRY003 Avoid specifying long messages outside the exception class
+ airflow/cli/commands/dag_command.py:218:26: EM102 Exception must not use an f-string literal, assign to variable first
+ airflow/cli/commands/dag_command.py:222:5: T201 `print` found
+ airflow/cli/commands/dag_command.py:233:15: TRY003 Avoid specifying long messages outside the exception class
+ airflow/cli/commands/dag_command.py:234:13: EM101 Exception must not use a string literal, assign to variable first
+ airflow/cli/commands/dag_command.py:237:5: RET506 Unnecessary `elif` after `raise` statement
+ airflow/cli/commands/dag_command.py:242:9: T201 `print` found
+ airflow/cli/commands/dag_command.py:254:15: TRY003 Avoid specifying long messages outside the exception class
+ airflow/cli/commands/dag_command.py:255:13: EM101 Exception must not use a string literal, assign to variable first
+ airflow/cli/commands/dag_command.py:258:5: RET506 Unnecessary `elif` after `raise` statement
+ airflow/cli/commands/dag_command.py:263:9: T201 `print` found
... 54 additional changes omitted for rule T201
+ airflow/cli/commands/dag_command.py:269:31: S603 `subprocess` call: check for execution of untrusted input
+ airflow/cli/commands/dag_command.py:269:31: S607 Starting a process with a partial executable path
+ airflow/cli/commands/dag_command.py:26:8: S404 `subprocess` module is possibly insecure
+ airflow/cli/commands/dag_command.py:277:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
+ airflow/cli/commands/dag_command.py:277:13: TRY200 Use `raise from` to specify exception cause
+ airflow/cli/commands/dag_command.py:277:19: TRY003 Avoid specifying long messages outside the exception class
+ airflow/cli/commands/dag_command.py:277:30: EM101 Exception must not use a string literal, assign to variable first
... 7052 additional changes omitted for project

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

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

+ examples/server/app/clustering/main.py:102:13: Q000 [*] Single quotes found but double quotes preferred
+ examples/server/app/clustering/main.py:103:11: Q000 [*] Single quotes found but double quotes preferred
+ examples/server/app/clustering/main.py:10:1: I001 [*] Import block is un-sorted or un-formatted
+ examples/server/app/clustering/main.py:112:32: C408 Unnecessary `dict` call (rewrite as a literal)
+ examples/server/app/clustering/main.py:113:13: Q000 [*] Single quotes found but double quotes preferred
+ examples/server/app/clustering/main.py:113:18: Q000 [*] Single quotes found but double quotes preferred
+ examples/server/app/clustering/main.py:113:34: Q000 [*] Single quotes found but double quotes preferred
+ examples/server/app/clustering/main.py:116:22: E225 [*] Missing whitespace around operator
+ examples/server/app/clustering/main.py:117:5: Q000 [*] Single quotes found but double quotes preferred
... 89 additional changes omitted for rule Q000
+ examples/server/app/clustering/main.py:159:34: ANN001 Missing type annotation for function argument `attrname`
... 1252 additional changes omitted for project

ibis-project/ibis (+43 -1 violations, +0 -0 fixes)

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

+ ibis/backends/conftest.py:285:41: PLR6201 Use a `set` literal when testing for membership
+ ibis/backends/conftest.py:294:9: PLC0415 `import` should be at the top-level of a file
+ ibis/backends/duckdb/__init__.py:1180:9: PLC0415 `import` should be at the top-level of a file
+ ibis/backends/duckdb/__init__.py:1181:9: PLC0415 `import` should be at the top-level of a file
+ ibis/backends/duckdb/__init__.py:1214:9: PLC0415 `import` should be at the top-level of a file
+ ibis/backends/duckdb/__init__.py:1257:9: PLR6301 Method `_get_temp_view_definition` could be a function, class method, or static method
+ ibis/backends/duckdb/__init__.py:1263:9: PLC0415 `import` should be at the top-level of a file
+ ibis/backends/duckdb/__init__.py:1277:9: PLR6301 Method `_compile_udf` could be a function, class method, or static method
+ ibis/backends/duckdb/__init__.py:155:9: PLC0415 `import` should be at the top-level of a file
... 16 additional changes omitted for rule PLC0415
+ ibis/backends/duckdb/__init__.py:97:1: PLR0904 Too many public methods (31 > 20)
... 34 additional changes omitted for project

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

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

- examples/example_bulkinsert_json.py:212:5: RUF014 Unreachable code in wait_tasks_to_state
- examples/example_bulkinsert_numpy.py:214:5: RUF014 Unreachable code in wait_tasks_to_state
- examples/iterator.py:113:5: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:120:9: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:122:13: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:125:9: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:126:13: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:128:9: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:131:5: RUF014 Unreachable code in query_iterate_collection_no_offset
- examples/iterator.py:133:9: RUF014 Unreachable code in query_iterate_collection_no_offset
... 1 additional changes omitted for project

pandas-dev/pandas (+255 -14 violations, +0 -0 fixes)

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

+ doc/make.py:134:24: PLR6201 Use a `set` literal when testing for membership
+ doc/make.py:152:9: PLR6301 Method `_open_browser` could be a function, class method, or static method
+ doc/make.py:159:9: PLR6301 Method `_get_page_title` could be a function, class method, or static method
+ doc/make.py:40:9: PLR0917 Too many positional arguments (8/5)
+ doc/make.py:71:9: PLR6301 Method `_process_single_doc` could be a function, class method, or static method
+ doc/make.py:80:9: F841 Local variable `base_name` is assigned to but never used
+ doc/make.py:81:25: PLR6201 Use a `set` literal when testing for membership
- pandas/_version.py:111:5: RUF014 Unreachable code in run_command
- pandas/_version.py:113:9: RUF014 Unreachable code in run_command
- pandas/_version.py:114:13: RUF014 Unreachable code in run_command
... 259 additional changes omitted for project

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

Changes by rule (221 rules affected)

code total + violation - violation + fix - fix
ANN101 1023 1023 0 0 0
ANN001 837 837 0 0 0
S101 642 642 0 0 0
ANN201 601 601 0 0 0
COM812 397 397 0 0 0
PLR6301 304 304 0 0 0
PLC0415 249 249 0 0 0
TRY003 232 232 0 0 0
ANN202 229 229 0 0 0
D102 210 210 0 0 0
D212 193 193 0 0 0
RUF014 143 0 143 0 0
ANN003 142 142 0 0 0
EM101 127 127 0 0 0
FBT001 126 126 0 0 0
D107 123 123 0 0 0
PLR0913 119 119 0 0 0
RUF012 118 118 0 0 0
ARG002 118 118 0 0 0
EM102 110 110 0 0 0
ARG001 101 101 0 0 0
E265 100 100 0 0 0
Q000 94 94 0 0 0
RET505 93 93 0 0 0
PLR0917 92 92 0 0 0
SLF001 83 83 0 0 0
TID252 81 81 0 0 0
PLR2004 80 80 0 0 0
D210 79 79 0 0 0
D401 76 76 0 0 0
ANN401 73 73 0 0 0
E402 72 72 0 0 0
T201 71 71 0 0 0
D300 69 69 0 0 0
PT007 67 67 0 0 0
Q002 65 65 0 0 0
PLR6201 58 58 0 0 0
FA100 56 56 0 0 0
AIR001 54 54 0 0 0
FBT002 48 48 0 0 0
ANN102 48 48 0 0 0
ANN204 46 46 0 0 0
D103 45 45 0 0 0
RET506 44 44 0 0 0
CPY001 43 43 0 0 0
TD003 43 43 0 0 0
D407 42 42 0 0 0
TD002 41 41 0 0 0
FIX002 38 38 0 0 0
C901 37 37 0 0 0
ANN002 33 33 0 0 0
RET503 33 33 0 0 0
PLW2901 32 32 0 0 0
D205 31 31 0 0 0
BLE001 27 27 0 0 0
FBT003 26 26 0 0 0
SIM300 26 26 0 0 0
C408 25 25 0 0 0
PT006 24 24 0 0 0
ERA001 23 23 0 0 0
B904 22 22 0 0 0
TRY200 22 22 0 0 0
PGH003 21 21 0 0 0
D100 20 20 0 0 0
TRY002 20 20 0 0 0
PLR0912 20 20 0 0 0
D200 19 19 0 0 0
PTH118 17 17 0 0 0
PLR0914 16 16 0 0 0
A002 16 16 0 0 0
PLR0915 16 16 0 0 0
PT004 16 16 0 0 0
B028 15 15 0 0 0
PTH123 15 15 0 0 0
D202 14 14 0 0 0
D404 13 13 0 0 0
PLR0904 13 13 0 0 0
PLW1514 13 13 0 0 0
PTH110 13 13 0 0 0
PLC2801 12 12 0 0 0
RET504 12 12 0 0 0
ANN205 12 12 0 0 0
PT001 11 11 0 0 0
E261 11 11 0 0 0
E721 11 11 0 0 0
PLW3201 10 10 0 0 0
SIM108 10 10 0 0 0
PLR0911 10 10 0 0 0
S603 9 9 0 0 0
PLR5501 9 9 0 0 0
A003 9 9 0 0 0
RSE102 9 9 0 0 0
E225 9 9 0 0 0
D415 8 8 0 0 0
N806 8 8 0 0 0
PLR1711 8 8 0 0 0
A001 8 8 0 0 0
TRY004 8 8 0 0 0
D101 8 8 0 0 0
S607 7 7 0 0 0
S404 7 7 0 0 0
D105 7 7 0 0 0
SIM102 7 7 0 0 0
S113 7 7 0 0 0
ANN206 7 7 0 0 0
DTZ003 7 7 0 0 0
D400 7 7 0 0 0
E231 7 7 0 0 0
TD004 6 6 0 0 0
TRY400 6 6 0 0 0
N801 6 6 0 0 0
PTH120 6 6 0 0 0
F841 6 6 0 0 0
PT023 6 6 0 0 0
PT018 6 6 0 0 0
PLR1704 5 5 0 0 0
B010 5 5 0 0 0
RET501 5 5 0 0 0
TRY201 5 5 0 0 0
FURB101 5 5 0 0 0
TD001 5 5 0 0 0
PTH207 5 5 0 0 0
PLR0916 5 5 0 0 0
D419 5 5 0 0 0
E226 5 5 0 0 0
D417 4 4 0 0 0
TD006 4 4 0 0 0
PLC1901 4 4 0 0 0
DTZ005 4 4 0 0 0
PLR1714 4 4 0 0 0
TRY300 4 4 0 0 0
PLW0603 4 4 0 0 0
B009 4 4 0 0 0
G004 4 4 0 0 0
D406 4 4 0 0 0
PT012 4 4 0 0 0
ARG005 4 4 0 0 0
PD011 4 4 0 0 0
E501 3 3 0 0 0
PERF203 3 3 0 0 0
PTH107 3 3 0 0 0
B007 3 3 0 0 0
FIX003 3 3 0 0 0
PTH111 3 3 0 0 0
SIM117 3 3 0 0 0
DTZ001 3 3 0 0 0
S403 3 3 0 0 0
PLW0108 3 3 0 0 0
B015 3 3 0 0 0
ARG004 3 3 0 0 0
PIE790 3 3 0 0 0
UP035 3 3 0 0 0
TCH001 3 3 0 0 0
B006 3 3 0 0 0
E201 3 3 0 0 0
E202 3 3 0 0 0
D412 3 3 0 0 0
RUF021 2 2 0 0 0
SIM118 2 2 0 0 0
D418 2 2 0 0 0
PLR1706 2 2 0 0 0
DTZ006 2 2 0 0 0
PERF401 2 2 0 0 0
N818 2 2 0 0 0
FIX001 2 2 0 0 0
N817 2 2 0 0 0
ARG003 2 2 0 0 0
PTH112 2 2 0 0 0
PTH116 2 2 0 0 0
PTH101 2 2 0 0 0
PLW0602 2 2 0 0 0
S106 2 2 0 0 0
PT011 2 2 0 0 0
N803 2 2 0 0 0
S301 2 2 0 0 0
I001 2 2 0 0 0
NPY002 2 2 0 0 0
E117 2 2 0 0 0
D208 2 2 0 0 0
PD002 2 2 0 0 0
E272 2 2 0 0 0
PTH113 2 2 0 0 0
DTZ007 1 1 0 0 0
PLW0120 1 1 0 0 0
B019 1 1 0 0 0
RET507 1 1 0 0 0
S110 1 1 0 0 0
C416 1 1 0 0 0
FIX004 1 1 0 0 0
FURB140 1 1 0 0 0
SIM201 1 1 0 0 0
FURB113 1 1 0 0 0
PTH109 1 1 0 0 0
SIM105 1 1 0 0 0
PT003 1 1 0 0 0
PT022 1 1 0 0 0
C419 1 1 0 0 0
B018 1 1 0 0 0
TCH003 1 1 0 0 0
DTZ002 1 1 0 0 0
PYI024 1 1 0 0 0
PT015 1 1 0 0 0
B011 1 1 0 0 0
INP001 1 1 0 0 0
G003 1 1 0 0 0
G002 1 1 0 0 0
G201 1 1 0 0 0
E271 1 1 0 0 0
D209 1 1 0 0 0
PYI030 1 1 0 0 0
D204 1 1 0 0 0
N812 1 1 0 0 0
D410 1 1 0 0 0
D411 1 1 0 0 0
PERF102 1 1 0 0 0
PLW1641 1 1 0 0 0
PTH108 1 1 0 0 0
PTH100 1 1 0 0 0
E266 1 1 0 0 0
PTH103 1 1 0 0 0
EM103 1 1 0 0 0

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not opposed to removing it, but I didn't have the impression that we had to spend much time maintaining it. I guess the only real cost was compile time.

Any specific reason that motivated you to remove the rule now?

@charliermarsh
Copy link
Member Author

Ah yeah, it's not motivated by anything specific, I'd just prefer to keep unused code in source rather than on main now that it's been a while.

@charliermarsh charliermarsh merged commit f9dd7bb into main Jan 12, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/unreachable branch January 12, 2024 01:24
augustelalande added a commit to augustelalande/ruff that referenced this pull request Apr 11, 2024
augustelalande added a commit to augustelalande/ruff that referenced this pull request Apr 13, 2024
augustelalande added a commit to augustelalande/ruff that referenced this pull request Apr 16, 2024
augustelalande added a commit to augustelalande/ruff that referenced this pull request Apr 16, 2024
augustelalande added a commit to augustelalande/ruff that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants