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

[flake8-todos] Allow VSCode GitHub PR extension style links in missing-todo-link (TD003) #15519

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jan 15, 2025

Summary

Allow links to issues that appear on the same line as the TODO directive, if they conform to the format that VSCode's GitHub PR extension produces.

Revival of #9627 (the branch was stale enough that rebasing was a lot harder than just making the changes anew). Credit should go to the author of that PR though.

Closes #8061

Co-authored-by: Martin Bernstorff [email protected]

@dylwil3 dylwil3 added rule Implementing or modifying a lint rule do-not-merge Do not merge this pull request labels Jan 15, 2025
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

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

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

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

- kubernetes_tests/test_kubernetes_pod_operator.py:1402:3: TD003 Missing issue link on the line following this TODO
- providers/src/airflow/providers/google/cloud/sensors/tasks.py:81:11: TD003 Missing issue link on the line following this TODO
- providers/src/airflow/providers/http/hooks/http.py:310:11: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/definitions/_internal/abstractoperator.py:329:19: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/execution_time/task_runner.py:505:11: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/execution_time/task_runner.py:506:11: TD003 Missing issue link on the line following this TODO
- task_sdk/tests/defintions/_internal/test_templater.py:58:11: TD003 Missing issue link on the line following this TODO
- tests/ti_deps/deps/test_mapped_task_upstream_dep.py:156:29: TD003 Missing issue link on the line following this TODO

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

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

- superset/sql_parse.py:87:3: TD003 Missing issue link on the line following this TODO

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

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

- src/bokeh/layouts.py:361:3: TD003 Missing issue link on the line following this TODO
- src/bokeh/resources.py:247:3: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_color_picker.py:107:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_daterange_slider.py:169:13: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_daterange_slider.py:192:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:163:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:197:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_range_slider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_range_slider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:186:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:266:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_spinner.py:228:11: TD003 Missing issue link on the line following this TODO
- tests/support/plugins/project.py:162:15: TD003 Missing issue link on the line following this TODO
- tests/unit/bokeh/server/views/test_multi_root_static_handler.py:45:50: TD003 Missing issue link on the line following this TODO

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

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

- zerver/lib/message_cache.py:452:15: TD003 Missing issue link on the line following this TODO

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
TD003 28 0 28 0 0

Linter (preview)

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

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

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

- kubernetes_tests/test_kubernetes_pod_operator.py:1402:3: TD003 Missing issue link on the line following this TODO
- providers/src/airflow/providers/google/cloud/sensors/tasks.py:81:11: TD003 Missing issue link on the line following this TODO
- providers/src/airflow/providers/http/hooks/http.py:310:11: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/definitions/_internal/abstractoperator.py:329:19: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/execution_time/task_runner.py:505:11: TD003 Missing issue link on the line following this TODO
- task_sdk/src/airflow/sdk/execution_time/task_runner.py:506:11: TD003 Missing issue link on the line following this TODO
- task_sdk/tests/defintions/_internal/test_templater.py:58:11: TD003 Missing issue link on the line following this TODO
- tests/ti_deps/deps/test_mapped_task_upstream_dep.py:156:29: TD003 Missing issue link on the line following this TODO

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

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

- superset/sql_parse.py:87:3: TD003 Missing issue link on the line following this TODO

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

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

- src/bokeh/layouts.py:361:3: TD003 Missing issue link on the line following this TODO
- src/bokeh/resources.py:247:3: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_color_picker.py:107:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_daterange_slider.py:169:13: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_daterange_slider.py:192:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:163:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:197:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_dateslider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_range_slider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_range_slider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:186:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:220:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:243:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_slider.py:266:11: TD003 Missing issue link on the line following this TODO
- tests/integration/widgets/test_spinner.py:228:11: TD003 Missing issue link on the line following this TODO
- tests/support/plugins/project.py:162:15: TD003 Missing issue link on the line following this TODO
- tests/unit/bokeh/server/views/test_multi_root_static_handler.py:45:50: TD003 Missing issue link on the line following this TODO

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

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

- zerver/lib/message_cache.py:452:15: TD003 Missing issue link on the line following this TODO

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
TD003 28 0 28 0 0

@AlexWaygood
Copy link
Member

Revival of #9627 (the branch was stale enough that rebasing was a lot harder than just making the changes anew). Credit should go to the author of that PR though.

I edited your PR message so that the commit should show up as co-authored by Martin if this PR is merged :-)

@dylwil3
Copy link
Collaborator Author

dylwil3 commented Jan 15, 2025

I edited your PR message so that the commit should show up as co-authored by Martin if this PR is merged :-)

Perfect, I was just looking up how to do that!

@dylwil3
Copy link
Collaborator Author

dylwil3 commented Jan 15, 2025

In other news, these ecosystem checks look correct to me. All of these folks dutifully putting issue links in their TODOs and getting yelled at by TD003... such injustice.

@dylwil3 dylwil3 enabled auto-merge (squash) January 15, 2025 23:34
@dylwil3 dylwil3 removed the do-not-merge Do not merge this pull request label Jan 15, 2025
@dylwil3 dylwil3 disabled auto-merge January 15, 2025 23:39
@dylwil3 dylwil3 enabled auto-merge (squash) January 15, 2025 23:43
@dylwil3 dylwil3 merged commit d2656e8 into astral-sh:main Jan 15, 2025
19 of 20 checks passed
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.

Align TD003 with VSCode github extension automatic issue creation
2 participants