-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[pydoclint] Implement DOC104 (docstring-different-order-parameters)
#23047
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @ntBre would you review my first PR in ruff? |
|
I'll take a look, thank you! |
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| UP043 | 250 | 0 | 250 | 0 | 0 |
| RUF061 | 206 | 0 | 206 | 0 | 0 |
| FURB110 | 154 | 0 | 154 | 0 | 0 |
| PLW0108 | 144 | 0 | 144 | 0 | 0 |
| PLC0207 | 54 | 0 | 54 | 0 | 0 |
| FURB171 | 35 | 0 | 35 | 0 | 0 |
| invalid-syntax: | 15 | 0 | 15 | 0 | 0 |
| RUF100 | 6 | 6 | 0 | 0 | 0 |
| SIM910 | 6 | 0 | 6 | 0 | 0 |
| RUF060 | 4 | 0 | 4 | 0 | 0 |
| RUF037 | 3 | 0 | 3 | 0 | 0 |
| A003 | 2 | 0 | 2 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+153 -70 violations, +0 -0 fixes in 18 projects; 37 projects unchanged)
DisnakeDev/disnake (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ disnake/colour.py:120:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + disnake/message.py:2439:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + disnake/ui/action_row.py:906:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order.
PlasmaPy/PlasmaPy (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ noxfile.py:448:15: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - noxfile.py:448:15: PLC0207 [*] String is split more times than necessary
apache/airflow (+17 -16 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ dev/backport/update_backport_status.py:80:21: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - dev/backport/update_backport_status.py:80:21: PLC0207 [*] String is split more times than necessary + dev/breeze/src/airflow_breeze/commands/common_options.py:524:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - dev/breeze/src/airflow_breeze/commands/common_options.py:524:26: PLC0207 [*] String is split more times than necessary + dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2815:50: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2815:50: PLC0207 [*] String is split more times than necessary ... 27 additional changes omitted for rule PLC0207 + kubernetes-tests/tests/kubernetes_tests/test_base.py:251:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. ... 26 additional changes omitted for project
apache/superset (+13 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ superset/charts/data/api.py:296:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + superset/dashboards/api.py:1242:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + superset/dashboards/api.py:503:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + superset/dashboards/api.py:555:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + superset/dashboards/api.py:617:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + superset/databases/api.py:1024:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. ... 5 additional changes omitted for rule DOC104 + superset/db_engine_specs/lint_metadata.py:100:17: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - superset/db_engine_specs/lint_metadata.py:100:17: PLC0207 [*] String is split more times than necessary + tests/common/query_context_generator.py:214:29: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - tests/common/query_context_generator.py:214:29: PLC0207 [*] String is split more times than necessary ... 6 additional changes omitted for project
bokeh/bokeh (+18 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ src/bokeh/core/has_props.py:493:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + src/bokeh/core/property/dataspec.py:442:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + src/bokeh/core/property/descriptors.py:662:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + src/bokeh/core/query.py:65:5: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + src/bokeh/core/validation/decorators.py:56:5: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + src/bokeh/driving.py:141:5: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. ... 10 additional changes omitted for rule DOC104 + src/bokeh/io/notebook.py:663:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - src/bokeh/io/notebook.py:663:26: PLC0207 [*] String is split more times than necessary + src/bokeh/util/token.py:142:41: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - src/bokeh/util/token.py:142:41: PLC0207 [*] String is split more times than necessary ... 11 additional changes omitted for project
facebookresearch/chameleon (+0 -8 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- chameleon/inference/chameleon.py:648:19: invalid-syntax: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) - chameleon/miniviewer/miniviewer.py:190:16: invalid-syntax: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) - chameleon/viewer/backend/models/chameleon_distributed.py:405:13: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10) - chameleon/viewer/backend/models/chameleon_distributed.py:818:17: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10) - chameleon/viewer/backend/models/chameleon_local.py:633:13: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10) - chameleon/viewer/backend/models/service.py:131:21: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10) - chameleon/viewer/backend/models/service.py:154:17: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10) - chameleon/viewer/backend/models/service.py:226:25: invalid-syntax: Cannot use `match` statement on Python 3.7 (syntax was added in Python 3.10)
freedomofpress/securedrop (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ securedrop/store.py:345:49: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - securedrop/store.py:345:49: PLC0207 [*] String is split more times than necessary
ibis-project/ibis (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ ibis/examples/gen_registry.py:125:52: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - ibis/examples/gen_registry.py:125:52: PLC0207 [*] String is split more times than necessary
langchain-ai/langchain (+48 -11 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ libs/core/langchain_core/example_selectors/semantic_similarity.py:280:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + libs/core/langchain_core/prompts/chat.py:1102:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + libs/core/langchain_core/prompts/chat.py:242:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + libs/core/langchain_core/prompts/chat.py:272:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + libs/core/langchain_core/prompts/chat.py:538:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + libs/core/langchain_core/prompts/structured.py:93:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. ... 32 additional changes omitted for rule DOC104 + libs/langchain/langchain_classic/agents/chat/output_parser.py:66:22: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - libs/langchain/langchain_classic/agents/chat/output_parser.py:66:22: PLC0207 [*] String is split more times than necessary + libs/langchain/langchain_classic/agents/conversational/output_parser.py:34:28: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - libs/langchain/langchain_classic/agents/conversational/output_parser.py:34:28: PLC0207 [*] String is split more times than necessary + libs/langchain/langchain_classic/agents/mrkl/output_parser.py:72:28: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - libs/langchain/langchain_classic/agents/mrkl/output_parser.py:72:28: PLC0207 [*] String is split more times than necessary ... 15 additional changes omitted for rule PLC0207 - libs/langchain/langchain_classic/retrievers/self_query/base.py:30:5: DOC501 Raised exception `ImportError` missing from docstring ... 46 additional changes omitted for project
pandas-dev/pandas (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ pandas/compat/_optional.py:165:14: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - pandas/compat/_optional.py:165:14: PLC0207 [*] String is split more times than necessary
pypa/cibuildwheel (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ bin/update_pythons.py:129:22: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - bin/update_pythons.py:129:22: PLC0207 [*] String is split more times than necessary + cibuildwheel/platforms/macos.py:154:31: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. - cibuildwheel/platforms/macos.py:154:31: PLC0207 [*] String is split more times than necessary + cibuildwheel/selector.py:78:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. - cibuildwheel/selector.py:78:26: PLC0207 [*] String is split more times than necessary
qdrant/qdrant-client (+0 -2 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- qdrant_client/async_qdrant_fastembed.py:226:16: invalid-syntax: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) - qdrant_client/qdrant_fastembed.py:223:16: invalid-syntax: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8)
reflex-dev/reflex (+25 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ reflex/assets.py:16:5: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/component.py:1073:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/component.py:1091:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/component.py:704:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/core/banner.py:300:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/core/banner.py:325:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/core/match.py:36:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/core/window_events.py:73:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/radix/primitives/progress.py:108:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. + reflex/components/radix/themes/color_mode.py:114:9: DOC104 Arguments are the same in the docstring and the function signature, but are in a different order. ... 15 additional changes omitted for project
... Truncated remaining completed project reports due to GitHub comment length restrictions
Changes by rule (4 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PLC0207 | 108 | 54 | 54 | 0 | 0 |
| DOC104 | 98 | 98 | 0 | 0 | 0 |
| invalid-syntax: | 15 | 0 | 15 | 0 | 0 |
| DOC501 | 2 | 1 | 1 | 0 | 0 |
Summary
Add
docstring-different-order-parameters(DOC104). This rule check that the parameters defined in a function signature have same order in docstring.Part of #12434.
Test Plan
Add test cases for google and numpy convention.