[codex] fix rule path validation for custom summary rules#944
[codex] fix rule path validation for custom summary rules#944MickeyWzt wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
=======================================
Coverage 78.89% 78.89%
=======================================
Files 81 81
Lines 7131 7131
=======================================
Hits 5626 5626
Misses 1505 1505
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
db840f6 to
a00321f
Compare
a00321f to
2802f3c
Compare
|
I added a second regression test for the missing python -m pytest tests/test_cli.py -q
# 2 passedOne note on the Codecov patch failure: this looks like a workflow checkout issue for fork PRs rather than a missing test. The The latest push restores the source diff to the clean implementation and keeps the added regression tests focused on the behavior in this PR. |
Summary
Fixes #936.
This delays validation of the default rules directory until the CLI actually needs to walk a rules directory. Commands that provide a specific JSON rule with
-s custom_rule.jsonno longer fail during Click option parsing just because the default rules directory has not been downloaded yet.Root cause
The
--ruleoption usedclick.Path(exists=True)with a default path. Click validates default values while parsing, so an absent default rules directory blocked commands even when the command used a specific rule file instead.Changes
exists=Truevalidation from the--ruleClick option.Validation
python -m pytest tests/test_cli.py -qpassed.python -m pytest tests/test_cli.py tests/test_freshquark.py -qshows the new test passing, while the existingtests/test_freshquark.pytests fail on Windows path separator expectations (/vs\\), unrelated to this change.