Skip to content

Fix docstring :param: names that do not match the signatures - #69966

Open
darkdi wants to merge 1 commit into
saltstack:3006.xfrom
darkdi:fix/docstring-param-names
Open

Fix docstring :param: names that do not match the signatures#69966
darkdi wants to merge 1 commit into
saltstack:3006.xfrom
darkdi:fix/docstring-param-names

Conversation

@darkdi

@darkdi darkdi commented Aug 6, 2026

Copy link
Copy Markdown

What does this PR do?

Twenty-six :param: fields name something the callable does not take. Docstrings only — no code, no behaviour, no tests.

Thirteen are renames:

Where Documented Actual
_filter_dict (napalm_network) search_values search_value
diff (rpm_lowpkg) package package_path
get_jids_filter (local_cache) filter_find_jobs filter_find_job
_purge_jobs (pgjsonb) job_age_in_seconds timestamp
TCPPuller.__init__ socket_path path
_lookup_dnspython server servers
caa_rec, mx_rec, srv_rec rdata rdatas
state_docs, module_docs (baredoc) name names
AESFuncs._handle_aes load data
is_reachable_host hostname entity_name

Two had the field itself malformed rather than misnamed:

  • Master.__init__ has :param dict: The salt options — a type with no name, so Sphinx renders a parameter called dict. It is opts.
  • LoadedFunc has :param func str: — the type and name are the wrong way round, and neither matches: the argument is name. LoadedCoro inherits __init__ and carries the same line, so both are corrected.

The rest document an argument that is simply gone: keep_loop in get_local_client, functions in auth, runners in states, settings in bcache.device, params in cql_query, tags_regex in _check_pending, src and dst in apply_template, is_file in _add_dependency, and extra_mods and so_mods in thin.gte, which takes nothing at all. Where a :type: line accompanied the entry, it went with it.

One I left alone: the Wildcard class docstring in zypperpkg documents :param ptn: and :return:, which belong to __call__, not to __init__. Moving them is a restructure rather than a name fix, so that is your call.

Every entry was opened and read against its signature. black --check flags the same four files before and after this change, so nothing here is new.

@darkdi
darkdi requested a review from a team as a code owner August 6, 2026 11:31

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make these changes against the earliest supported branch where the problem exists. 3006.x most likely.

@twangboy twangboy added the test:full Run the full test suite label Aug 6, 2026
@twangboy twangboy added this to the Sulphur v3006.28 milestone Aug 6, 2026
@darkdi
darkdi force-pushed the fix/docstring-param-names branch from 76774d4 to edeed6c Compare August 6, 2026 17:37
@darkdi
darkdi changed the base branch from master to 3006.x August 6, 2026 17:37
@darkdi

darkdi commented Aug 6, 2026

Copy link
Copy Markdown
Author

Retargeted to 3006.x and rebuilt the change there rather than porting the master diff, so what you see is what the checker finds on that branch.

One entry did not come across: TCPPuller.__init__ documents socket_path on master, but that code is not in 3006.x. So this is 25 fields instead of 26 — I will send the remaining one against master separately once this lands, unless you would rather have it another way.

Everything else is identical. 3006.x has a further 41 fields of the same kind that master no longer has; I left them out to keep this the same change you already looked at, and can send them as a follow-up if that is useful.

@twangboy

twangboy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The remaining one might be in 3007.x or 3008.x

@darkdi

darkdi commented Aug 7, 2026

Copy link
Copy Markdown
Author

It is in all three: 3007.x, 3008.x and master carry :param str/int socket_path: on TCPPuller.__init__, which takes path. 3006.x is the only one without that code.

So 3007.x is the earliest branch where it exists. I will send it there once this one lands, as a one-line change rather than bundling it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants