fix: validate default rule path only when used - #937
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #937 +/- ##
=======================================
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:
|
c8bd5b4 to
e7c5349
Compare
e7c5349 to
28b0ef7
Compare
|
I checked this PR locally on Windows and found one small portability issue in the current test suite. At python -m pytest tests/test_cli.py -qfails on Windows in Changing the message to use the plain path keeps the CLI output more readable and makes the assertion portable: f"Path {rule} does not exist."I also tried the two requested simplifications locally:
With those changes plus the message tweak: python -m pytest tests/test_cli.py -q
# 3 passed
uv run --with black black --check tests/test_cli.py
# passed
git diff --check
# passed |
- Set exists=False directly on the --rule option instead of patching the parameter after the command is defined. - Use the plain path in the missing-rule error so the assertion is portable on Windows (repr escapes backslashes). - Extract the duplicated Quark mock into a mock_quark fixture.
|
Thanks both. Addressed in efa3c54:
|
haeter525
left a comment
There was a problem hiding this comment.
Thank you @gaoflow for the fix!
Summary
Fixes #936.
Tests
Note: I did not run because the current file has pre-existing formatting that newer Black would reflow outside this fix. I kept the production diff to the rule option and the runtime path check.