Add '--list-checks' flag that lists all implemented checks#324
Add '--list-checks' flag that lists all implemented checks#324vickgoodman wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new --list-checks CLI flag intended to print all implemented Beman Standard checks (with their Requirement/Recommendation type), and updates the README’s captured --help output accordingly.
Changes:
- Add
--list-checkshandling to the CLI, printing registered check names and their types. - Update README
--helpsnippet to include--list-checks(and reflect current CLI options).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
beman_tidy/cli.py |
Adds --list-checks via a custom argparse action and implements check listing output. |
README.md |
Updates the documented --help output to include the new flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parser.add_argument( | ||
| "--checks", help="array of checks to run", type=str, default=None | ||
| "--list-checks", | ||
| help="list all implemented checks", | ||
| action=ListChecksAction, | ||
| ) |
There was a problem hiding this comment.
I tested this locally and beman-tidy --list-checks works without repo_path. The custom ListChecksAction exits during argument parsing before argparse performs the final required positional argument validation. Normal commands such as beman-tidy --verbose still fail with the expected missing repo_path error.
| usage: beman-tidy [-h] [--version] [--fix-inplace | --no-fix-inplace] [--verbose | --no-verbose] [--require-all | --no-require-all] [--list-checks] [--checks CHECKS] [--config CONFIG] | ||
| repo_path | ||
|
|
||
| positional arguments: | ||
| repo_path path to the repository to check | ||
|
|
There was a problem hiding this comment.
Not relevant. See prev comment.
| beman_standard_check_config = load_beman_standard_config() | ||
| if not beman_standard_check_config or len(beman_standard_check_config) == 0: | ||
| parser.exit(status=1, message="Failed to download the beman standard. STOP.\n") | ||
|
|
Usage example:
$ beman-tidy --list-checks /path/to/repooutputs the same