-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix TODO directive out of bounds acccess #13756
Conversation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
COM812 | 228 | 228 | 0 | 0 | 0 |
S101 | 212 | 212 | 0 | 0 | 0 |
ERA001 | 173 | 173 | 0 | 0 | 0 |
D102 | 126 | 126 | 0 | 0 | 0 |
E501 | 90 | 90 | 0 | 0 | 0 |
D103 | 80 | 80 | 0 | 0 | 0 |
D101 | 61 | 61 | 0 | 0 | 0 |
FBT001 | 44 | 44 | 0 | 0 | 0 |
TRY003 | 43 | 43 | 0 | 0 | 0 |
ANN001 | 40 | 40 | 0 | 0 | 0 |
D300 | 32 | 32 | 0 | 0 | 0 |
PLR2004 | 31 | 31 | 0 | 0 | 0 |
D210 | 31 | 31 | 0 | 0 | 0 |
Q002 | 29 | 29 | 0 | 0 | 0 |
D107 | 28 | 28 | 0 | 0 | 0 |
FBT002 | 27 | 27 | 0 | 0 | 0 |
EM101 | 27 | 27 | 0 | 0 | 0 |
EM102 | 19 | 19 | 0 | 0 | 0 |
RET505 | 18 | 18 | 0 | 0 | 0 |
C901 | 18 | 18 | 0 | 0 | 0 |
FIX002 | 17 | 17 | 0 | 0 | 0 |
TD002 | 17 | 17 | 0 | 0 | 0 |
TD003 | 17 | 17 | 0 | 0 | 0 |
D205 | 15 | 15 | 0 | 0 | 0 |
D212 | 14 | 14 | 0 | 0 | 0 |
RET504 | 13 | 13 | 0 | 0 | 0 |
PLR0912 | 13 | 13 | 0 | 0 | 0 |
ANN201 | 12 | 12 | 0 | 0 | 0 |
N806 | 11 | 11 | 0 | 0 | 0 |
ARG001 | 10 | 10 | 0 | 0 | 0 |
D400 | 10 | 10 | 0 | 0 | 0 |
D415 | 10 | 10 | 0 | 0 | 0 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 0 |
RUF100 | 1 | 1 | 0 | 0 | 0 |
TCH003 | 1 | 1 | 0 | 0 | 0 |
UP035 | 1 | 1 | 0 | 0 | 0 |
ARG005 | 1 | 1 | 0 | 0 | 0 |
PTH111 | 1 | 1 | 0 | 0 | 0 |
D105 | 1 | 1 | 0 | 0 | 0 |
TRY201 | 1 | 1 | 0 | 0 | 0 |
SLF001 | 1 | 1 | 0 | 0 | 0 |
RUF001 | 1 | 1 | 0 | 0 | 0 |
PT017 | 1 | 1 | 0 | 0 | 0 |
TRY400 | 1 | 1 | 0 | 0 | 0 |
TD004 | 1 | 1 | 0 | 0 | 0 |
PLR5501 | 1 | 1 | 0 | 0 | 0 |
D413 | 1 | 1 | 0 | 0 | 0 |
PLW2901 | 1 | 1 | 0 | 0 | 0 |
D104 | 1 | 1 | 0 | 0 | 0 |
D404 | 1 | 1 | 0 | 0 | 0 |
RET508 | 1 | 1 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+1864 -0 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)
apache/airflow (+109 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:114:6: COM812 [*] Trailing comma missing + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:122:6: COM812 [*] Trailing comma missing + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:138:16: DTZ001 `datetime.datetime()` called without a `tzinfo` argument + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:143:107: COM812 [*] Trailing comma missing + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:152:78: COM812 [*] Trailing comma missing + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:162:83: COM812 [*] Trailing comma missing + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:168:82: COM812 [*] Trailing comma missing ... 10 additional changes omitted for rule COM812 + providers/tests/system/google/cloud/cloud_sql/example_cloud_sql.py:1:1: CPY001 Missing copyright notice at top of file + tests/www/views/test_views_dataset.py:100:40: PLR2004 Magic value used in comparison, consider replacing `400` with a constant variable + tests/www/views/test_views_dataset.py:105:40: PLR2004 Magic value used in comparison, consider replacing `400` with a constant variable ... 99 additional changes omitted for project
apache/superset (+250 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ superset/config.py:1002:24: RUF012 Mutable class attributes should be annotated with `typing.ClassVar` + superset/config.py:1007:21: RUF012 Mutable class attributes should be annotated with `typing.ClassVar` + superset/config.py:1018:9: ERA001 Found commented-out code + superset/config.py:1019:9: ERA001 Found commented-out code + superset/config.py:1020:9: ERA001 Found commented-out code + superset/config.py:1021:9: ERA001 Found commented-out code + superset/config.py:1029:1: ERA001 Found commented-out code + superset/config.py:105:1: ERA001 Found commented-out code ... 167 additional changes omitted for rule ERA001 + superset/config.py:1071:89: E501 Line too long (90 > 88) + superset/config.py:1092:64: COM812 [*] Trailing comma missing ... 240 additional changes omitted for project
bokeh/bokeh (+180 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ src/bokeh/colors/color.py:116:9: D210 [*] No whitespaces allowed surrounding docstring text + src/bokeh/colors/color.py:116:9: D300 [*] Use triple double quotes `"""` + src/bokeh/colors/color.py:116:9: Q002 [*] Single quote docstring found but double quotes preferred + src/bokeh/colors/color.py:11:1: E265 [*] Block comment should start with `# ` + src/bokeh/colors/color.py:133:9: D210 [*] No whitespaces allowed surrounding docstring text + src/bokeh/colors/color.py:133:9: D300 [*] Use triple double quotes `"""` + src/bokeh/colors/color.py:133:9: Q002 [*] Single quote docstring found but double quotes preferred + src/bokeh/colors/color.py:13:1: E265 [*] Block comment should start with `# ` + src/bokeh/colors/color.py:148:9: D210 [*] No whitespaces allowed surrounding docstring text + src/bokeh/colors/color.py:148:9: D300 [*] Use triple double quotes `"""` ... 170 additional changes omitted for project
zulip/zulip (+1325 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ corporate/lib/stripe.py:1000:57: COM812 [*] Trailing comma missing + corporate/lib/stripe.py:1005:9: D102 Missing docstring in public method + corporate/lib/stripe.py:1009:9: D102 Missing docstring in public method + corporate/lib/stripe.py:1013:9: D102 Missing docstring in public method + corporate/lib/stripe.py:1017:9: D102 Missing docstring in public method + corporate/lib/stripe.py:1021:9: D102 Missing docstring in public method + corporate/lib/stripe.py:1037:9: D102 Missing docstring in public method ... 120 additional changes omitted for rule D102 + corporate/lib/stripe.py:1038:9: SIM103 Return the condition directly + corporate/lib/stripe.py:1042:9: PLR6301 Method `get_remote_server_legacy_plan` could be a function, class method, or static method + corporate/lib/stripe.py:1043:75: COM812 [*] Trailing comma missing + corporate/lib/stripe.py:1046:101: E501 Line too long (116 > 100) + corporate/lib/stripe.py:1057:75: COM812 [*] Trailing comma missing + corporate/lib/stripe.py:1063:9: S101 Use of `assert` detected + corporate/lib/stripe.py:1068:64: COM812 [*] Trailing comma missing + corporate/lib/stripe.py:1074:9: S101 Use of `assert` detected + corporate/lib/stripe.py:1099:16: RET504 Unnecessary assignment to `customer` before `return` statement + corporate/lib/stripe.py:1103:61: FBT001 Boolean-typed positional argument in function definition + corporate/lib/stripe.py:1103:61: FBT002 Boolean default positional argument in function definition + corporate/lib/stripe.py:1103:87: COM812 [*] Trailing comma missing + corporate/lib/stripe.py:1106:92: COM812 [*] Trailing comma missing ... 197 additional changes omitted for rule COM812 + corporate/lib/stripe.py:111:5: D103 Missing docstring in public function + corporate/lib/stripe.py:1128:101: E501 Line too long (104 > 100) + corporate/lib/stripe.py:1130:13: S101 Use of `assert` detected + corporate/lib/stripe.py:1137:86: FBT003 Boolean positional value in function call + corporate/lib/stripe.py:1144:9: D205 1 blank line required between summary line and description + corporate/lib/stripe.py:1144:9: D212 [*] Multi-line docstring summary should start at the first line + corporate/lib/stripe.py:1145:101: E501 Line too long (101 > 100) + corporate/lib/stripe.py:114:5: SIM108 Use ternary operator `precision = 0 if cents % 100 == 0 else 2` instead of `if`-`else`-block + corporate/lib/stripe.py:1150:9: PT018 Assertion should be broken down into multiple parts + corporate/lib/stripe.py:1150:9: S101 Use of `assert` detected + corporate/lib/stripe.py:1157:19: DOC501 Raised exception `BillingError` missing from docstring + corporate/lib/stripe.py:1157:19: TRY003 Avoid specifying long messages outside the exception class + corporate/lib/stripe.py:1158:17: EM101 Exception must not use a string literal, assign to variable first + corporate/lib/stripe.py:1163:13: S101 Use of `assert` detected + corporate/lib/stripe.py:1164:13: S101 Use of `assert` detected ... 207 additional changes omitted for rule S101 ... 1290 additional changes omitted for project
Changes by rule (112 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
COM812 | 228 | 228 | 0 | 0 | 0 |
S101 | 212 | 212 | 0 | 0 | 0 |
ERA001 | 173 | 173 | 0 | 0 | 0 |
D102 | 126 | 126 | 0 | 0 | 0 |
E501 | 90 | 90 | 0 | 0 | 0 |
D103 | 80 | 80 | 0 | 0 | 0 |
D101 | 61 | 61 | 0 | 0 | 0 |
FBT001 | 44 | 44 | 0 | 0 | 0 |
TRY003 | 43 | 43 | 0 | 0 | 0 |
ANN001 | 40 | 40 | 0 | 0 | 0 |
D300 | 32 | 32 | 0 | 0 | 0 |
PLR2004 | 31 | 31 | 0 | 0 | 0 |
D210 | 31 | 31 | 0 | 0 | 0 |
Q002 | 29 | 29 | 0 | 0 | 0 |
D107 | 28 | 28 | 0 | 0 | 0 |
PLR6301 | 27 | 27 | 0 | 0 | 0 |
FBT002 | 27 | 27 | 0 | 0 | 0 |
EM101 | 27 | 27 | 0 | 0 | 0 |
E226 | 24 | 24 | 0 | 0 | 0 |
EM102 | 19 | 19 | 0 | 0 | 0 |
PLR6201 | 19 | 19 | 0 | 0 | 0 |
RET505 | 18 | 18 | 0 | 0 | 0 |
C901 | 18 | 18 | 0 | 0 | 0 |
FIX002 | 17 | 17 | 0 | 0 | 0 |
TD002 | 17 | 17 | 0 | 0 | 0 |
TD003 | 17 | 17 | 0 | 0 | 0 |
E265 | 16 | 16 | 0 | 0 | 0 |
D205 | 15 | 15 | 0 | 0 | 0 |
D212 | 14 | 14 | 0 | 0 | 0 |
RET504 | 13 | 13 | 0 | 0 | 0 |
PLR0912 | 13 | 13 | 0 | 0 | 0 |
ANN201 | 12 | 12 | 0 | 0 | 0 |
DOC201 | 12 | 12 | 0 | 0 | 0 |
N806 | 11 | 11 | 0 | 0 | 0 |
ARG001 | 10 | 10 | 0 | 0 | 0 |
D400 | 10 | 10 | 0 | 0 | 0 |
D415 | 10 | 10 | 0 | 0 | 0 |
B904 | 10 | 10 | 0 | 0 | 0 |
PLR0914 | 10 | 10 | 0 | 0 | 0 |
PLR0913 | 9 | 9 | 0 | 0 | 0 |
PLR0917 | 9 | 9 | 0 | 0 | 0 |
PLR0915 | 9 | 9 | 0 | 0 | 0 |
PLC1901 | 9 | 9 | 0 | 0 | 0 |
RUF012 | 8 | 8 | 0 | 0 | 0 |
E402 | 7 | 7 | 0 | 0 | 0 |
CPY001 | 6 | 6 | 0 | 0 | 0 |
SIM103 | 6 | 6 | 0 | 0 | 0 |
FBT003 | 6 | 6 | 0 | 0 | 0 |
PT018 | 6 | 6 | 0 | 0 | 0 |
F841 | 6 | 6 | 0 | 0 | 0 |
A001 | 6 | 6 | 0 | 0 | 0 |
PTH118 | 5 | 5 | 0 | 0 | 0 |
S105 | 5 | 5 | 0 | 0 | 0 |
TCH002 | 5 | 5 | 0 | 0 | 0 |
D200 | 5 | 5 | 0 | 0 | 0 |
PLR0911 | 5 | 5 | 0 | 0 | 0 |
PLC0415 | 5 | 5 | 0 | 0 | 0 |
B008 | 5 | 5 | 0 | 0 | 0 |
PLR0904 | 5 | 5 | 0 | 0 | 0 |
D401 | 5 | 5 | 0 | 0 | 0 |
D202 | 5 | 5 | 0 | 0 | 0 |
BLE001 | 4 | 4 | 0 | 0 | 0 |
DOC501 | 4 | 4 | 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 | 1 | 1 | 0 | 0 | 0 |
D413 | 1 | 1 | 0 | 0 | 0 |
PLW2901 | 1 | 1 | 0 | 0 | 0 |
FURB145 | 1 | 1 | 0 | 0 | 0 |
S405 | 1 | 1 | 0 | 0 | 0 |
PLR0916 | 1 | 1 | 0 | 0 | 0 |
D104 | 1 | 1 | 0 | 0 | 0 |
D404 | 1 | 1 | 0 | 0 | 0 |
PLR1702 | 1 | 1 | 0 | 0 | 0 |
RET508 | 1 | 1 | 0 | 0 | 0 |
FURB118 | 1 | 1 | 0 | 0 | 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The ecosystem checks seems unrelated.
Hmm, what's up with our ecosystem checks. Let me re-run |
Uhhh, I think I know what's happening. We upload the results whenever a contributor's branch is called main.. wonderful https://github.com/astral-sh/ruff/actions/runs/11332780423?pr=13574 |
Okay I don't know what's happening lol. |
It's interesting that the number of additions in this PR is quite close to the number of removals in #13640 (comment). |
Yes... the PR should not have removed any violations. I expect that it was panicking for all those repos, which is why there are so many changes. I ran the ecosystem check locally against the commit before I merged that PR and the result is: zulip/zulip (+0 -7 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL
- zerver/actions/create_realm.py:239:11: FIX004 Line contains HACK, consider resolving the issue - zerver/management/commands/list_realms.py:56:15: FIX004 Line contains HACK, consider resolving the issue - zerver/tests/test_queue_worker.py:423:11: FIX004 Line contains HACK, consider resolving the issue - zerver/tests/test_slack_importer.py:1244:15: FIX004 Line contains HACK, consider resolving the issue - zerver/views/realm_icon.py:65:7: FIX004 Line contains HACK, consider resolving the issue - zerver/views/realm_logo.py:68:7: FIX004 Line contains HACK, consider resolving the issue - zilencer/management/commands/populate_db.py:109:7: FIX004 Line contains HACK, consider resolving the issue Changes by rule (1 rules affected)
|
Summary
Fixes an out of bound access that I introduced #13640 where the old code was incorrect too, because it didn't handle joined comments correctly.
This PR fixes the out of bound access and adds a test for joined comments (
# test # TODO: fixme
).Fixes #13755
Test Plan
See added tests