Skip to content

Conversation

@augustelalande
Copy link
Contributor

Summary

Implement docstring-missing-parameter (DOC101). This rule checks that all parameters present in a functions signature are also documented in the docstring.

Split from #13280.

Part of #12434.

Test Plan

Test cases added.

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+13587 -19 violations, +0 -0 fixes in 7 projects; 48 projects unchanged)

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

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

+ disnake/abc.py:1189:9: DOC101 Parameter `kwargs` missing from the docstring
+ disnake/app_commands.py:1114:9: DOC101 These parameters are missing from the docstring: `name`, `description`, `type`, `required`, `choices`, `options`, `channel_types`, `autocomplete`, `min_value`, `max_value`, `min_length`, `max_length`
+ disnake/app_commands.py:386:9: DOC101 These parameters are missing from the docstring: `name`, `value`
+ disnake/app_commands.py:411:9: DOC101 These parameters are missing from the docstring: `name`, `description`, `type`, `required`, `choices`, `options`, `channel_types`, `autocomplete`, `min_value`, `max_value`, `min_length`, `max_length`
+ disnake/automod.py:345:9: DOC101 These parameters are missing from the docstring: `keyword_filter`, `regex_patterns`, `presets`, `allow_list`, `mention_total_limit`, `mention_raid_protection_enabled`
+ disnake/channel.py:1624:9: DOC101 Parameter `kwargs` missing from the docstring
+ disnake/channel.py:2478:9: DOC101 Parameter `kwargs` missing from the docstring
+ disnake/channel.py:3011:9: DOC101 Parameter `kwargs` missing from the docstring
+ disnake/channel.py:3205:9: DOC101 These parameters are missing from the docstring: `name`, `options`
+ disnake/channel.py:3220:9: DOC101 These parameters are missing from the docstring: `name`, `options`
... 208 additional changes omitted for project

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

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

+ airflow-core/docs/conf.py:147:5: DOC101 Parameter `exclude_patterns` missing from the docstring
+ airflow-core/src/airflow/api/common/delete_dag.py:44:5: DOC101 These parameters are missing from the docstring: `dag_id`, `keep_records_in_log`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:110:5: DOC101 These parameters are missing from the docstring: `dag`, `state`, `task_ids`, `run_ids`
+ airflow-core/src/airflow/api/common/mark_tasks.py:124:5: DOC101 These parameters are missing from the docstring: `tasks`, `downstream`, `upstream`
+ airflow-core/src/airflow/api/common/mark_tasks.py:142:5: DOC101 These parameters are missing from the docstring: `dag`, `run_id`, `future`, `past`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:190:5: DOC101 These parameters are missing from the docstring: `dag_id`, `run_id`, `state`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:213:5: DOC101 These parameters are missing from the docstring: `dag`, `run_id`, `commit`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:272:5: DOC101 These parameters are missing from the docstring: `dag`, `run_id`, `commit`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:358:5: DOC101 These parameters are missing from the docstring: `new_state`, `dag`, `run_id`, `commit`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:389:5: DOC101 These parameters are missing from the docstring: `dag`, `run_id`, `commit`, `session`
+ airflow-core/src/airflow/api/common/mark_tasks.py:55:5: DOC101 These parameters are missing from the docstring: `tasks`, `run_id`, `upstream`, `downstream`, `future`, `past`, `state`, `commit`, `session`
+ airflow-core/src/airflow/api/common/trigger_dag.py:140:5: DOC101 These parameters are missing from the docstring: `dag_id`, `triggered_by`, `triggering_user_name`, `run_after`, `run_id`, `conf`, `logical_date`, `replace_microseconds`, `session`
+ airflow-core/src/airflow/api/common/trigger_dag.py:55:5: DOC101 These parameters are missing from the docstring: `dag_id`, `dag_bag`, `triggered_by`, `triggering_user_name`, `run_after`, `run_id`, `conf`, `logical_date`, `replace_microseconds`, `session`
+ airflow-core/src/airflow/api_fastapi/app.py:111:5: DOC101 These parameters are missing from the docstring: `config`, `testing`, `apps`
+ airflow-core/src/airflow/api_fastapi/app.py:150:5: DOC101 Parameter `app` missing from the docstring
+ airflow-core/src/airflow/api_fastapi/app.py:175:5: DOC101 Parameter `app` missing from the docstring
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:109:9: DOC101 Parameter `token` missing from the docstring
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:125:9: DOC101 These parameters are missing from the docstring: `user`, `expiration_time_in_seconds`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:145:9: DOC101 Parameter `user` missing from the docstring
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:333:9: DOC101 These parameters are missing from the docstring: `requests`, `user`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:358:9: DOC101 These parameters are missing from the docstring: `requests`, `user`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:384:9: DOC101 These parameters are missing from the docstring: `requests`, `user`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:409:9: DOC101 These parameters are missing from the docstring: `requests`, `user`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:436:9: DOC101 These parameters are missing from the docstring: `user`, `method`, `session`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:467:9: DOC101 These parameters are missing from the docstring: `conn_ids`, `user`, `method`, `team_name`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:496:9: DOC101 These parameters are missing from the docstring: `user`, `method`, `session`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:536:9: DOC101 These parameters are missing from the docstring: `dag_ids`, `user`, `method`, `team_name`
+ airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:565:9: DOC101 These parameters are missing from the docstring: `user`, `method`, `session`
... 7818 additional changes omitted for project

apache/superset (+2175 -13 violations, +0 -0 fixes)

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

+ RELEASING/changelog.py:107:9: DOC101 Parameter `git_log` missing from the docstring
+ RELEASING/changelog.py:335:5: DOC101 These parameters are missing from the docstring: `ctx`, `previous_version`, `current_version`
+ RELEASING/changelog.py:347:5: DOC101 Parameter `base_parameters` missing from the docstring
+ RELEASING/changelog.py:380:5: D400 First line should end with a period
- RELEASING/changelog.py:380:5: D400 First line should end with a period
+ RELEASING/changelog.py:380:5: D415 First line should end with a period, question mark, or exclamation point
- RELEASING/changelog.py:380:5: D415 First line should end with a period, question mark, or exclamation point
+ RELEASING/changelog.py:380:5: DOC101 These parameters are missing from the docstring: `base_parameters`, `csv`, `access_token`, `risk`
+ RELEASING/changelog.py:52:9: DOC101 Parameter `other` missing from the docstring
+ RELEASING/changelog.py:87:9: DOC101 Parameter `pr_number` missing from the docstring
... 2157 additional changes omitted for rule DOC101
... 2178 additional changes omitted for project

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

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

+ examples/advanced/extensions/parallel_plot/parallel_plot.py:15:5: DOC101 These parameters are missing from the docstring: `df`, `color`, `palette`
+ examples/interaction/js_callbacks/js_on_event.py:16:5: DOC101 These parameters are missing from the docstring: `div`, `attributes`
+ examples/models/gauges.py:33:5: DOC101 Parameter `val` missing from the docstring
+ examples/models/trail.py:20:5: DOC101 These parameters are missing from the docstring: `p1`, `p2`
+ examples/output/jupyter/push_notebook/Numba Image Example.ipynb:cell 22:3:5: DOC101 These parameters are missing from the docstring: `img`, `tmp`
+ examples/server/app/events_app.py:17:5: DOC101 These parameters are missing from the docstring: `div`, `attributes`
+ examples/server/app/events_app.py:39:5: DOC101 Parameter `attributes` missing from the docstring
+ examples/topics/geo/tile_demo.py:10:5: DOC101 These parameters are missing from the docstring: `longitude`, `latitude`
+ scripts/milestone.py:196:5: DOC101 These parameters are missing from the docstring: `title`, `token`, `allow_closed`
+ scripts/milestone.py:26:5: DOC101 These parameters are missing from the docstring: `query`, `token`
... 303 additional changes omitted for project

langchain-ai/langchain (+2408 -6 violations, +0 -0 fixes)

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

+ libs/cli/langchain_cli/cli.py:74:5: DOC101 These parameters are missing from the docstring: `port`, `host`
+ libs/cli/langchain_cli/namespaces/app.py:159:5: DOC101 These parameters are missing from the docstring: `dependencies`, `api_path`, `project_dir`, `repo`, `branch`, `pip`
+ libs/cli/langchain_cli/namespaces/app.py:312:5: DOC101 These parameters are missing from the docstring: `api_paths`, `project_dir`
+ libs/cli/langchain_cli/namespaces/app.py:359:5: DOC101 These parameters are missing from the docstring: `port`, `host`, `app`
+ libs/cli/langchain_cli/namespaces/app.py:63:5: DOC101 These parameters are missing from the docstring: `name`, `package`, `pip`, `noninteractive`
+ libs/cli/langchain_cli/namespaces/integration.py:248:5: DOC101 These parameters are missing from the docstring: `name`, `name_class`, `component_type`, `destination_dir`
... 2397 additional changes omitted for rule DOC101
+ libs/core/langchain_core/language_models/fake_chat_models.py:317:9: PLR1702 Too many nested blocks (6 > 5)
- libs/core/langchain_core/language_models/fake_chat_models.py:317:9: PLR1702 Too many nested blocks (6 > 5)
- libs/core/langchain_core/runnables/graph_mermaid.py:410:5: DOC501 Raised exception `ValueError` missing from docstring
+ libs/core/langchain_core/runnables/graph_mermaid.py:410:5: DOC501 Raised exception `ValueError` missing from docstring
... 2404 additional changes omitted for project

reflex-dev/reflex (+15 -0 violations, +0 -0 fixes)

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

+ reflex/event.py:854:9: DOC101 Parameter `_prog` missing from the docstring
+ reflex/reflex.py:129:5: DOC101 These parameters are missing from the docstring: `name`, `template`, `ai`
+ reflex/reflex.py:142:5: DOC101 These parameters are missing from the docstring: `env`, `frontend`, `backend`, `frontend_port`, `backend_port`, `backend_host`, `single_port`
+ reflex/reflex.py:359:5: DOC101 These parameters are missing from the docstring: `env`, `frontend_only`, `backend_only`, `frontend_port`, `backend_port`, `backend_host`, `single_port`
+ reflex/reflex.py:417:5: DOC101 These parameters are missing from the docstring: `dry`, `rich`
+ reflex/reflex.py:497:5: DOC101 These parameters are missing from the docstring: `zip`, `frontend_only`, `backend_only`, `zip_dest_dir`, `upload_db_file`, `env`, `backend_excluded_dirs`, `ssr`
+ reflex/reflex.py:63:5: DOC101 These parameters are missing from the docstring: `name`, `template`, `ai`
+ reflex/reflex.py:658:5: DOC101 Parameter `message` missing from the docstring
+ reflex/reflex.py:767:5: DOC101 These parameters are missing from the docstring: `app_name`, `app_id`, `region`, `env`, `vmtype`, `hostname`, `interactive`, `envfile`, `project`, `project_name`, `token`, `config_path`, `backend_excluded_dirs`, `ssr`
+ reflex/reflex.py:841:5: DOC101 Parameter `new_name` missing from the docstring
... 5 additional changes omitted for project

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

Changes by rule (9 rules affected)

code total + violation - violation + fix - fix
DOC101 13568 13568 0 0 0
D415 12 6 6 0 0
D200 6 3 3 0 0
DOC501 6 3 3 0 0
D202 4 2 2 0 0
DOC201 4 2 2 0 0
D400 2 1 1 0 0
D212 2 1 1 0 0
PLR1702 2 1 1 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.

1 participant