Skip to content

fix: validate default rules path only when used - #945

Closed
qinfenyinluo wants to merge 1 commit into
ev-flow:masterfrom
qinfenyinluo:codex/fix-rule-default-validation
Closed

qinfenyinluo wants to merge 1 commit into
ev-flow:masterfrom
qinfenyinluo:codex/fix-rule-default-validation

Conversation

@qinfenyinluo

Copy link
Copy Markdown

Summary

  • Allow --rule to be parsed even when the default rules directory has not been downloaded yet.
  • Report a clear warning only when Quark actually needs to load rules from the configured rules path.
  • Add CLI regression tests for using a custom single rule file while the default rules path is missing.

Root cause

--rule used click.Path(exists=True) together with the default rules directory. Click validated that default during argument parsing, so commands that supplied their own rule file via --summary custom_rule.json could fail before Quark reached the code path that uses the custom rule.

Validation

  • python -m pytest tests\test_cli.py -q -> 2 passed
  • python -m black --check tests\test_cli.py -> passed
  • git diff --cached --check -> passed before commit

I also tried python -m pytest tests\test_cli.py tests\test_freshquark.py -q. The new CLI tests passed, but the existing tests/test_freshquark.py assertions fail on Windows because expected paths use \ while the mocked command builds paths with /; this appears unrelated to this change.

Closes #936

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.89%. Comparing base (cf35a66) to head (3a2bf3d).

Files with missing lines Patch % Lines
quark/cli.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #945   +/-   ##
=======================================
  Coverage   78.89%   78.89%           
=======================================
  Files          81       81           
  Lines        7131     7131           
=======================================
  Hits         5626     5626           
  Misses       1505     1505           
Flag Coverage Δ
unittests 78.89% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qinfenyinluo

Copy link
Copy Markdown
Author

Closing this as duplicate after noticing that #937 already covers the same issue. Sorry for the extra noise, and thanks for maintaining Quark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--rule default path validated even when unused

1 participant