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

[wps-light] Implement consecutive-underscores-in-name (WPS116) #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Lokejoke
Copy link
Owner

@Lokejoke Lokejoke commented Nov 16, 2024

Summary

This PR implements consecutive-underscores-in-name.
Local variable name words separated by multiple underscores is less readable;
it is addressed here.

cargo test

Test Plan

Copy link

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

apache/airflow (+122 -1228 violations, +0 -0 fixes)

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

+ airflow/cli/cli_config.py:599:1: WPS116 Variable name ARG_DB_VERSION__UPGRADE contains consecutive underscors inside.
+ airflow/cli/cli_config.py:606:1: WPS116 Variable name ARG_DB_REVISION__UPGRADE contains consecutive underscors inside.
+ airflow/cli/cli_config.py:610:1: WPS116 Variable name ARG_DB_VERSION__DOWNGRADE contains consecutive underscors inside.
+ airflow/cli/cli_config.py:618:1: WPS116 Variable name ARG_DB_REVISION__DOWNGRADE contains consecutive underscors inside.
+ airflow/jobs/scheduler_job_runner.py:874:9: WPS116 Function name _set_span_attrs__process_executor_events contains consecutive underscors inside.
- airflow/lineage/hook.py:100:9: D212 [*] Multi-line docstring summary should start at the first line
- airflow/lineage/hook.py:115:13: DOC201 `return` is not documented in docstring
- airflow/lineage/hook.py:119:108: COM812 [*] Trailing comma missing
- airflow/lineage/hook.py:131:16: BLE001 Do not catch blind exception: `Exception`
- airflow/lineage/hook.py:135:9: ANN201 Missing return type annotation for public function `add_input_asset`
- airflow/lineage/hook.py:151:9: ANN201 Missing return type annotation for public function `add_output_asset`
- airflow/lineage/hook.py:188:5: D212 [*] Multi-line docstring summary should start at the first line
- airflow/lineage/hook.py:194:31: ANN002 Missing type annotation for `*_`
- airflow/lineage/hook.py:194:35: ANN003 Missing type annotation for `**__`
- airflow/lineage/hook.py:194:9: ANN201 Missing return type annotation for public function `add_input_asset`
- airflow/lineage/hook.py:194:9: D102 Missing docstring in public method
- airflow/lineage/hook.py:197:32: ANN002 Missing type annotation for `*_`
- airflow/lineage/hook.py:197:36: ANN003 Missing type annotation for `**__`
- airflow/lineage/hook.py:197:9: ANN201 Missing return type annotation for public function `add_output_asset`
- airflow/lineage/hook.py:197:9: D102 Missing docstring in public method
- airflow/lineage/hook.py:1:1: CPY001 Missing copyright notice at top of file
- airflow/lineage/hook.py:1:1: D100 Missing docstring in public module
- airflow/lineage/hook.py:201:9: D102 Missing docstring in public method
- airflow/lineage/hook.py:205:111: E501 Line too long (111 > 110)
- airflow/lineage/hook.py:205:112: COM812 [*] Trailing comma missing
- airflow/lineage/hook.py:213:24: ANN003 Missing type annotation for `**kwargs`
- airflow/lineage/hook.py:213:26: ARG002 Unused method argument: `kwargs`
- airflow/lineage/hook.py:213:9: ANN204 Missing return type annotation for special method `__init__`
- airflow/lineage/hook.py:213:9: D107 Missing docstring in `__init__`
- airflow/lineage/hook.py:219:16: RET504 Unnecessary assignment to `hook_lineage` before `return` statement
- airflow/lineage/hook.py:219:9: DOC201 `return` is not documented in docstring
- airflow/lineage/hook.py:224:12: PLW0603 Using the global statement to update `_hook_lineage_collector` is discouraged
- airflow/lineage/hook.py:224:12: PLW0603 Using the global statement to update `_hook_lineage_collector` is discouraged
... 1317 additional changes omitted for project

apache/superset (+90 -159 violations, +0 -0 fixes)

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

- superset/db_engine_specs/databricks.py:108:5: D200 One-line docstring should fit on one line
- superset/db_engine_specs/databricks.py:108:5: D212 [*] Multi-line docstring summary should start at the first line
- superset/db_engine_specs/databricks.py:118:5: D200 One-line docstring should fit on one line
- superset/db_engine_specs/databricks.py:118:5: D212 [*] Multi-line docstring summary should start at the first line
- superset/db_engine_specs/databricks.py:128:5: D205 1 blank line required between summary line and description
- superset/db_engine_specs/databricks.py:128:5: D212 [*] Multi-line docstring summary should start at the first line
- superset/db_engine_specs/databricks.py:156:7: D101 Missing docstring in public class
- superset/db_engine_specs/databricks.py:160:15: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
- superset/db_engine_specs/databricks.py:168:7: D101 Missing docstring in public class
- superset/db_engine_specs/databricks.py:172:9: D102 Missing docstring in public method
... 239 additional changes omitted for project

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

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

+ tests/support/util/api.py:47:11: WPS116 Class name Test___all__ contains consecutive underscors inside.
+ tests/support/util/api.py:59:13: WPS116 Function name test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/_testing/util/test_env.py:43:1: WPS116 Variable name Test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/application/handlers/test___init___handlers.py:55:1: WPS116 Variable name Test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/application/test___init___application.py:49:1: WPS116 Variable name Test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/client/test___init___client.py:41:1: WPS116 Variable name Test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/colors/test___init___colors.py:54:1: WPS116 Variable name Test___all__ contains consecutive underscors inside.
+ tests/unit/bokeh/colors/test_groups.py:203:5: WPS116 Function name test__all__ contains consecutive underscors inside.
+ tests/unit/bokeh/colors/test_named.py:181:5: WPS116 Function name test__all__ contains consecutive underscors inside.
+ tests/unit/bokeh/command/subcommands/test_info.py:88:5: WPS116 Function name test__version_missing contains consecutive underscors inside.
... 241 additional changes omitted for project

zulip/zulip (+12 -124 violations, +0 -0 fixes)

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

+ zerver/lib/message_cache.py:28:5: WPS116 Annotation name user_profile__email contains consecutive underscors inside.
+ zerver/lib/message_cache.py:29:5: WPS116 Annotation name user_profile__full_name contains consecutive underscors inside.
+ zerver/lib/soft_deactivation.py:38:5: WPS116 Annotation name recipient__type_id contains consecutive underscors inside.
+ zerver/lib/topic.py:59:1: WPS116 Variable name MESSAGE__TOPIC contains consecutive underscors inside.
+ zerver/lib/types.py:135:5: WPS116 Annotation name stream__name contains consecutive underscors inside.
+ zerver/lib/user_status.py:20:5: WPS116 Annotation name user_profile__presence_enabled contains consecutive underscors inside.
... 7 additional changes omitted for rule WPS116
- zerver/views/streams.py:1000:5: D103 Missing docstring in public function
- zerver/views/streams.py:1005:5: A002 Function argument `property` is shadowing a Python builtin
- zerver/views/streams.py:1009:60: COM812 [*] Trailing comma missing
- zerver/views/streams.py:1012:66: COM812 [*] Trailing comma missing
... 126 additional changes omitted for project

Changes by rule (109 rules affected)

code total + violation - violation + fix - fix
WPS116 473 473 0 0 0
ANN001 412 0 412 0 0
ANN201 197 0 197 0 0
COM812 170 0 170 0 0
PT019 76 0 76 0 0
ARG002 60 0 60 0 0
D102 35 0 35 0 0
PLR6301 33 0 33 0 0
SLF001 33 0 33 0 0
D212 29 1 28 0 0
D103 27 0 27 0 0
PLC0415 26 0 26 0 0
ANN202 24 0 24 0 0
ANN002 20 0 20 0 0
ANN003 20 0 20 0 0
C408 20 0 20 0 0
CPY001 19 0 19 0 0
DOC201 15 0 15 0 0
T201 14 0 14 0 0
ARG001 12 0 12 0 0
RUF012 11 0 11 0 0
F841 11 0 11 0 0
D200 10 1 9 0 0
ANN204 10 0 10 0 0
PGH003 10 0 10 0 0
D205 10 0 10 0 0
AIR001 9 0 9 0 0
D101 8 0 8 0 0
PLR0913 7 0 7 0 0
S108 7 0 7 0 0
D100 6 0 6 0 0
N806 6 0 6 0 0
SIM117 6 0 6 0 0
SIM910 6 0 6 0 0
D400 6 0 6 0 0
PLC1901 5 0 5 0 0
D415 5 0 5 0 0
D401 5 0 5 0 0
C901 4 0 4 0 0
PLR0917 4 0 4 0 0
PTH123 4 0 4 0 0
ARG003 4 0 4 0 0
PTH118 4 0 4 0 0
D202 4 0 4 0 0
S101 4 0 4 0 0
PLR0915 3 0 3 0 0
PLW2901 3 0 3 0 0
FBT003 3 0 3 0 0
RUF005 3 0 3 0 0
TRY003 3 0 3 0 0
EM101 3 0 3 0 0
PTH107 3 0 3 0 0
ANN401 3 0 3 0 0
PLR0912 3 0 3 0 0
E501 2 0 2 0 0
D107 2 0 2 0 0
PLW0603 2 0 2 0 0
E731 2 0 2 0 0
B015 2 0 2 0 0
PT006 2 0 2 0 0
ARG004 2 0 2 0 0
PLR2004 2 0 2 0 0
PLC2701 2 0 2 0 0
S105 2 0 2 0 0
TCH003 2 0 2 0 0
ERA001 2 0 2 0 0
FURB101 2 0 2 0 0
PLW1514 2 0 2 0 0
FIX002 2 0 2 0 0
TD002 2 0 2 0 0
TD003 2 0 2 0 0
TCH002 2 0 2 0 0
TRY300 2 0 2 0 0
D404 2 0 2 0 0
A001 2 0 2 0 0
SIM108 2 0 2 0 0
B007 2 0 2 0 0
BLE001 1 0 1 0 0
RET504 1 0 1 0 0
S324 1 0 1 0 0
N813 1 0 1 0 0
S606 1 0 1 0 0
B010 1 0 1 0 0
PLW0108 1 0 1 0 0
RUF022 1 0 1 0 0
RET501 1 0 1 0 0
N801 1 0 1 0 0
S608 1 0 1 0 0
FBT002 1 0 1 0 0
S404 1 0 1 0 0
PLR0904 1 0 1 0 0
PLR1704 1 0 1 0 0
PTH120 1 0 1 0 0
PTH110 1 0 1 0 0
ANN206 1 0 1 0 0
DTZ001 1 0 1 0 0
UP007 1 0 1 0 0
TRY002 1 0 1 0 0
D105 1 0 1 0 0
UP035 1 0 1 0 0
RUF031 1 0 1 0 0
PLR6201 1 0 1 0 0
A002 1 0 1 0 0
RET505 1 0 1 0 0
DOC501 1 0 1 0 0
D209 1 0 1 0 0
SIM103 1 0 1 0 0
PLR0914 1 0 1 0 0
FBT001 1 0 1 0 0

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

Successfully merging this pull request may close these issues.

3 participants