You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bring update-readmes onto the same shape as the other tools and
drop a few oddities that were copy-pasted from a plugin
skeleton and never cleaned up:
- Import _common for iter_check_plugins() and die(). The plugin
discovery loop drops from an 8-line `lib.disk.walk_directory`
+ substring-filter chain down to a list comprehension over
`_common.iter_check_plugins(skip=frozenset())`. `skip` is empty
on purpose so the example plugin's README still gets its Help
block refreshed (keeps prior behaviour).
- Add CONTRIBUTING.md header comment and bump __version__ onto
the repo's YYYYMMDDXX convention.
- Rewrite the module docstring from a plugin-style DESCRIPTION
blob into a proper "what does this tool do" explanation.
- Drop the `sys.exit(3)` fallback around parse_args(). That exit
code only makes sense in a Nagios check plugin where 3 maps
to STATE_UNKNOWN; update-readmes is a repo tool and should
follow argparse's own exit conventions (0 for -h/-V, 2 for
parse errors).
- Replace `lib.base.cu()` in the top-level except handler with
`_common.die()` for the same reason. cu() emits a Nagios
UNKNOWN line which is meaningless for a tool.
- Pull the magic numbers out into HELP_TIMEOUT_SECONDS and
MAX_PARALLEL_HELP_CALLS so they are easy to tune.
- Fix the get_help() return shape: it used to return either a
2-tuple on success or a 3-tuple on error, which forced every
caller to `len()`-check the result. It now always returns
`(name, help_text_or_None)` and logs the error inline.
Verified: `tools/update-readmes` walks 238 READMEs cleanly,
reports 0 updates (tree was already up to date), exits 0.
tools/run-linter-checks stays green.
0 commit comments