Breaking: Convert coverage-dir from flag to positional argument#100
Merged
bartveneman merged 2 commits intomainfrom Mar 18, 2026
Merged
Breaking: Convert coverage-dir from flag to positional argument#100bartveneman merged 2 commits intomainfrom
bartveneman merged 2 commits intomainfrom
Conversation
Breaking change: `--coverage-dir=<path>` is replaced by a positional argument, e.g. `css-coverage ./coverage --min-coverage=0.8`. Updates argument parsing, validation error messages, tests, and help text. https://claude.ai/code/session_01HyhRGi53stHdRSZBkxTAeQ
Bundle ReportChanges will decrease total bundle size by 24 bytes (-0.09%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: cli.js-esmAssets Changed:
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
=======================================
Coverage 96.71% 96.71%
=======================================
Files 14 14
Lines 1064 1064
Branches 142 142
=======================================
Hits 1029 1029
Misses 34 34
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
positionals[0] is string | undefined; the assertion is safe because we throw before reaching the return when coverage_dir is missing. https://claude.ai/code/session_01HyhRGi53stHdRSZBkxTAeQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored the CLI argument parsing to accept
<coverage-dir>as a positional argument instead of a named flag (--coverage-dir), improving the command-line interface usability, because many CLI's accept auto-complete for positionals, not for named arguments.Key Changes
Argument parsing: Modified
parse_arguments()to acceptcoverage-diras the first positional argument instead of a named optionallowPositionals: trueinparseArgs()configuration'coverage-dir'from the options objectpositionals[0]instead ofvalues['coverage-dir']CLI interface: Updated the command signature from
--coverage-dir=<dir>to<coverage-dir>css-coverage <coverage-dir> --min-coverage=<number> [options]--coverage-dirdescription from OPTIONS to ARGUMENTS sectionTests: Updated all test cases to reflect the new positional argument syntax
<coverage-dir>instead of--coverage-dir--coverage-dirflag (no longer applicable)Documentation: Updated all CLI examples in help text to use the new positional argument syntax
Implementation Details
The change maintains backward compatibility in the returned
CliArgumentsobject structure while improving the command-line UX by using a more conventional positional argument pattern for the primary required input.Closes #74