Commit 23487af
committed
Two fixes for PR #141 per issue #171:
1. Add missing @WHO/@WHAT/@PART/@entry file headers to the 3 new files
introduced by PR #141:
- scripts/baseline_diff.py
- scripts/exit_policy.py
- scripts/git_integration.py
(issue #171 explicitly mentions baseline_diff.py; exit_policy.py and
git_integration.py have the same gap — fixed for consistency since
CONTRIBUTING.md mandates the header on all new files.)
2. Restore the `-f` shortcut conflict guard in scripts/codelens.py that
was removed by PR #153 (graphml, issue #59 Phase 3). The guard checks
`existing_option_strings` before adding `-f` to a subparser, so
commands like `affected` (issue #62) that use `-f` for `--filter`
don't conflict with the global `--format -f` shortcut.
This bug made `codelens --help` and every CLI invocation crash with
`argparse.ArgumentError: argument --format/-f: conflicting option
string: -f`. It was a pre-existing regression on main (introduced
when PR #153 was merged) that blocked PR #141's tests from running.
The fix restores the pre-#153 logic:
```python
if "format" not in existing_dests:
format_args = ["--format"]
if "-f" not in existing_option_strings:
format_args.append("-f")
sub.add_argument(*format_args, choices=[...], ...)
```
Verified:
- `codelens --command-count` works (returns 75)
- `codelens --help` works
- 99 PR #141 tests pass (test_baseline_diff + test_check_ci_flags +
test_exit_policy + test_git_integration)
- 196 passed regression (test_cli + test_formatters + test_command_count +
test_command_registry + 4 PR #141 test files)
- 135 passed (test_graphml_formatter + test_diff_scope + test_secrets_gitleaks
— confirms the format change doesn't regress graphml/diff-base/gitleaks)
- sync_command_count.py --check: all docs in sync (count=75)
Findings (per pre-flight SKILL.md — flag to BOS):
- The `-f` conflict bug was introduced by PR #153 (issue #59 Phase 3,
graphml export). PR #153 simplified the format-arg logic and
accidentally dropped the `existing_option_strings` check. This fix
restores the check while keeping the `graphml` choice. No regression
to graphml functionality (test_graphml_formatter.py: 35 passed).
- PR #141 was already rebased on main; no merge conflicts. The rebase +
these fixes make PR #141 mergeable.
1 parent 74fa6c6 commit 23487af
4 files changed
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
891 | 895 | | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
898 | 901 | | |
899 | 902 | | |
900 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
0 commit comments