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] Unformatted special comments (RUF102) #14111

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Resolves #10160.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo
Copy link
Contributor Author

I'm not sure why the snapshot is empty. Debugging showed that new diagnostics are correctly added, yet it's almost as if the rule never ran.

Copy link
Contributor

github-actions bot commented Nov 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

DisnakeDev/disnake (+6 -0 violations, +0 -0 fixes)

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

+ Comment: "# noqa: DTZ005  # the point of this is to test naive dts"
+ Comment: "# noqa: PLC0205  # this is intentional"
+ Comment: "# noqa: S101 # TODO: remove this ignore (didn't want to touch this)"
+ disnake/player.py:210:29: RUF102 [*] Unformatted special comment
+ tests/test_embeds.py:67:39: RUF102 [*] Unformatted special comment
+ tests/test_utils.py:387:28: RUF102 [*] Unformatted special comment

RasaHQ/rasa (+33 -2 violations, +0 -0 fixes)

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

+ rasa/api.py:143:62: RUF102 [*] Unformatted special comment
+ rasa/api.py:144:62: RUF102 [*] Unformatted special comment
+ rasa/core/actions/action.py:1026:68: RUF102 [*] Unformatted special comment
+ rasa/core/actions/action.py:952:63: RUF102 [*] Unformatted special comment
- rasa/core/actions/two_stage_fallback.py:184:105: RUF100 [*] Unused blanket `noqa` directive
+ rasa/core/agent.py:422:66: RUF102 [*] Unformatted special comment
+ rasa/core/brokers/kafka.py:95:9: RUF102 [*] Unformatted special comment
... 28 additional changes omitted for rule RUF102
- rasa/core/test.py:462:97: RUF100 [*] Unused blanket `noqa` directive
... 27 additional changes omitted for project

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

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

+ Comment: "# noqa: D101 Ignore missing docstring"
+ Comment: "# noqa: D101 Ignore missing docstring"
+ Comment: "# noqa: F401 Used in ``airflow.contrib.hooks.bigquery``"
+ Comment: "# noqa: PT012 error happen on context exit"
+ Comment: "# noqa: UP006 - prevent Sphinx failing"
+ Comment: "# noqa: UP007 - prevent Sphinx failing"
+ Comment: "# noqa: UP007 - prevent Sphinx failing"
+ Comment: "# noqa: UP007 - prevent Sphinx failing"
+ airflow/hooks/__init__.py:18:1: RUF102 [*] Unformatted special comment
+ airflow/jobs/scheduler_job_runner.py:882:143: RUF102 [*] Unformatted special comment
... 110 additional changes omitted for project

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

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

+ superset/commands/chart/export.py:17:1: RUF102 [*] Unformatted special comment
+ superset/commands/dashboard/export.py:17:1: RUF102 [*] Unformatted special comment
+ superset/commands/database/export.py:17:1: RUF102 [*] Unformatted special comment
+ superset/commands/dataset/export.py:17:1: RUF102 [*] Unformatted special comment
+ superset/commands/query/export.py:17:1: RUF102 [*] Unformatted special comment
+ superset/models/helpers.py:1228:30: RUF102 [*] Unformatted special comment
+ superset/models/sql_lab.py:362:30: RUF102 [*] Unformatted special comment
+ tests/integration_tests/access_tests.py:17:1: RUF102 [*] Unformatted special comment
+ tests/integration_tests/advanced_data_type/api_tests.py:17:1: RUF102 [*] Unformatted special comment
+ tests/integration_tests/annotation_layers/api_tests.py:17:1: RUF102 [*] Unformatted special comment
... 45 additional changes omitted for project

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

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

+ release/ui.py:27:22: RUF102 [*] Unformatted special comment
+ src/bokeh/__init__.py:36:16: RUF102 [*] Unformatted special comment
+ src/bokeh/__init__.py:88:26: RUF102 [*] Unformatted special comment
+ src/bokeh/__init__.py:91:29: RUF102 [*] Unformatted special comment
+ src/bokeh/__init__.py:96:17: RUF102 [*] Unformatted special comment
+ src/bokeh/__init__.py:97:70: RUF102 [*] Unformatted special comment
+ src/bokeh/__main__.py:27:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/__init__.py:22:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/application.py:24:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/__init__.py:17:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/code.py:31:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/code_runner.py:17:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/directory.py:43:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/document_lifecycle.py:17:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/function.py:33:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/handler.py:38:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/lifecycle.py:17:16: RUF102 [*] Unformatted special comment
+ src/bokeh/application/handlers/notebook.py:24:16: RUF102 [*] Unformatted special comment
... 819 additional changes omitted for project

ibis-project/ibis (+7 -0 violations, +0 -0 fixes)

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

+ .github/workflows/algolia/upload-algolia-api.py:164:54: RUF102 [*] Unformatted special comment
+ .github/workflows/algolia/upload-algolia-api.py:178:56: RUF102 [*] Unformatted special comment
+ .github/workflows/algolia/upload-algolia-api.py:190:66: RUF102 [*] Unformatted special comment
+ .github/workflows/algolia/upload-algolia-api.py:203:53: RUF102 [*] Unformatted special comment
+ .github/workflows/algolia/upload-algolia-api.py:208:66: RUF102 [*] Unformatted special comment
+ ibis/backends/tests/test_client.py:1496:37: RUF102 [*] Unformatted special comment
+ ibis/tests/expr/test_struct.py:44:19: RUF102 [*] Unformatted special comment

lnbits/lnbits (+0 -0 violations, +0 -0 fixes)

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


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

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


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

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

+ Comment: "# noqa: E501 (http link too long)"
+ Comment: "# noqa: F401 # isort: skip # type: ignore[reportUnusedImport]"
+ Comment: "# noqa: F401 isort:skip"
+ Comment: "# noqa: F401 isort:skip"
+ Comment: "# noqa: F401 isort:skip"
+ Comment: "# noqa: F401 isort:skip"
+ Comment: "# noqa: F401 isort:skip"
... 29 additional changes omitted for rule F401
+ Comment: "# note: ISO8601 formats go down a fastpath, so we need to check both"
+ Comment: "# note: ISO8601 formats go down a fastpath, so we need to check both"
+ Comment: "# note: ISO8601 formats go down a fastpath, so we need to check both"
... 28 additional changes omitted for project

pypa/build (+0 -0 violations, +0 -0 fixes)

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


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

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


pypa/setuptools (+33 -0 violations, +0 -0 fixes)

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

+ Comment: "# noqa: C901  # is too complex (11)  # FIXME"
+ Comment: "# noqa: C901  # is too complex (11)  # FIXME"
+ Comment: "# noqa: C901  # is too complex (12)  # FIXME"
+ Comment: "# noqa: C901  # is too complex (12)"
+ Comment: "# noqa: C901  # is too complex (14)  # FIXME"
+ Comment: "# noqa: C901  # is too complex (14)  # FIXME"
... 5 additional changes omitted for rule C901
+ Comment: "# noqa: F401  # import setuptools to monkeypatch distutils"
+ Comment: "# noqa: F401 # ensure monkey patch to metadata"
+ Comment: "# noqa: F401 # force distutils.core to be patched"
+ Comment: "# noqa: F401 # force distutils.core to be patched"
... 23 additional changes omitted for project

python/typeshed (+18 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W

+ Comment: "# Any of _CellValue # noqa: Y047 # Used in other modules"
+ Comment: "# flake8: noqa: NQA102 # https://github.com/plinss/flake8-noqa/issues/22"
+ Comment: "# noqa: F401  # pyright: ignore[reportUnusedImport]"
+ Comment: "# noqa: F811 # intentional workaround"
+ Comment: "# noqa: Y001 # Exists at runtime"
+ Comment: "# noqa: Y001 # Exists at runtime"
+ Comment: "# noqa: Y026  # TODO: Use TypeAlias once mypy bugs are fixed"
+ Comment: "# noqa: Y026  # TODO: Use TypeAlias once mypy bugs are fixed"
+ Comment: "# noqa: Y029  # needed as it's abstract on the superclass"
+ Comment: "# noqa: Y029  # needed as it's abstract on the superclass"
... 8 additional changes omitted for project

python-poetry/poetry (+0 -0 violations, +0 -0 fixes)

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


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

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

+ Comment: "# all tokens in this decoder use default(18)  # noqa: E501 # isort: skip"
+ Comment: "# noqa: B007 # var used right after loop"
+ Comment: "# noqa: E501  # 1, 238 are customized so they stay. 74 should be deleted"
+ Comment: "# noqa: E501  # BEN memecoin but cc has bitcoen"
+ Comment: "# noqa: E501  # FRAX"
+ Comment: "# noqa: E501  # GDX but cc has gold miner"
+ Comment: "# noqa: E501  # JEFF memecoin but cc has jeff on space"
... 59 additional changes omitted for rule E501
+ Comment: "# noqa: PLW1641  # hash implemented by superclass"
+ Comment: "# noqa: PLW1641  # hash implemented by superclass"
+ Comment: "# noqa: PLW1641  # hash in superclass"
+ Comment: "# noqa: PLW1641  # hash in superclass"
+ Comment: "# noqa: RUF012  # can't control library's base class typing"
+ Comment: "# noqa: RUF012  # can't control library's base class typing"
+ Comment: "# noqa: RUF027  # to be filled by the action item"
+ Comment: "# noqa: S404  # is only used to execute rotki code here"
+ Comment: "# noqa: S607  # is only used to execute rotki code here"
+ Comment: "# noqa: SIM115  # we close at stop()"
+ pytestgeventwrapper.py:1:35: RUF102 [*] Unformatted special comment
+ pytestgeventwrapper.py:2:21: RUF102 [*] Unformatted special comment
+ rotkehlchen/__main__.py:1:28: RUF102 [*] Unformatted special comment
+ rotkehlchen/__main__.py:2:21: RUF102 [*] Unformatted special comment
... 952 additional changes omitted for project

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

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


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

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


spruceid/siwe-py (+0 -0 violations, +0 -0 fixes)

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


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

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

+ Comment: "# noqa: B006 # Mapping is indeed immutable, but Json's type annotation drops that information"
+ Comment: "# noqa: B018 # prevents RawPostDataException"
+ Comment: "# noqa: F403 isort: skip"
+ Comment: "# noqa: F403 isort: skip"
+ Comment: "# noqa: F403 isort: skip"
+ Comment: "# noqa: F403 isort: skip"
+ Comment: "# noqa: F403 isort: skip"
+ Comment: "# noqa: F403 isort: skip"
... 3 additional changes omitted for rule F403
+ Comment: "# noqa: UP038  # https://github.com/python/mypy/issues/17413"
+ corporate/lib/stripe_event_handler.py:115:59: RUF102 [*] Unformatted special comment
... 14 additional changes omitted for project

indico/indico (+10 -0 violations, +0 -0 fixes)

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

+ indico/core/celery/__init__.py:51:32: RUF102 [*] Unformatted special comment
+ indico/core/db/sqlalchemy/__init__.py:9:24: RUF102 [*] Unformatted special comment
+ indico/core/signals/event/__init__.py:8:1: RUF102 [*] Unformatted special comment
+ indico/modules/categories/serialize.py:55:100: RUF102 [*] Unformatted special comment
+ indico/modules/events/abstracts/forms.py:584:73: RUF102 [*] Unformatted special comment
+ indico/modules/events/abstracts/forms.py:618:73: RUF102 [*] Unformatted special comment
+ indico/web/forms/fields/__init__.py:8:1: RUF102 [*] Unformatted special comment
+ indico/web/http_api/__init__.py:8:1: RUF102 [*] Unformatted special comment
+ indico/web/http_api/metadata/serializer.py:53:63: RUF102 [*] Unformatted special comment
+ indico/web/http_api/metadata/serializer.py:54:61: RUF102 [*] Unformatted special comment

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

Changes by rule (46 rules affected)

code total + violation - violation + fix - fix
RUF102 2033 2033 0 0 0
E501 65 65 0 0 0
F401 43 43 0 0 0
C901 10 10 0 0 0
B018 9 9 0 0 0
Y047 8 8 0 0 0
F403 8 8 0 0 0
UP031 6 6 0 0 0
RUF029 5 5 0 0 0
PLW1641 4 4 0 0 0
UP007 3 3 0 0 0
ISO8601 3 3 0 0 0
D101 2 2 0 0 0
F811 2 2 0 0 0
Y001 2 2 0 0 0
Y026 2 2 0 0 0
Y029 2 2 0 0 0
RUF012 2 2 0 0 0
A001 2 2 0 0 0
B023 2 2 0 0 0
SIM105 2 2 0 0 0
RUF100 2 0 2 0 0
DTZ005 1 1 0 0 0
PLC0205 1 1 0 0 0
S101 1 1 0 0 0
PT012 1 1 0 0 0
UP006 1 1 0 0 0
UP036 1 1 0 0 0
NQA102 1 1 0 0 0
PYI036 1 1 0 0 0
B007 1 1 0 0 0
RUF027 1 1 0 0 0
S404 1 1 0 0 0
S607 1 1 0 0 0
SIM115 1 1 0 0 0
B006 1 1 0 0 0
UP038 1 1 0 0 0
B008 1 1 0 0 0
B009 1 1 0 0 0
B024 1 1 0 0 0
PERF401 1 1 0 0 0
PT011 1 1 0 0 0
SIM102 1 1 0 0 0
SIM202 1 1 0 0 0
PYI063 1 1 0 0 0
UP032 1 1 0 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.

Request: Enforce space after colon (:) for special comments
1 participant