Skip to content

Default value for coverage report html#573

Merged
Chemaclass merged 3 commits into
mainfrom
feat/default-value-for-coverage-report-html
Dec 21, 2025
Merged

Default value for coverage report html#573
Chemaclass merged 3 commits into
mainfrom
feat/default-value-for-coverage-report-html

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

@Chemaclass Chemaclass commented Dec 21, 2025

📚 Description

Adds a sensible default value for --coverage-report-html option, making it optional to specify the directory path. When no directory is provided, the HTML report is generated in coverage/html.

This follows the same pattern already used by --coverage-report which defaults to coverage/lcov.info.

Motivation

Previously, users had to explicitly provide a directory path when using --coverage-report-html:

# Before: directory was required
bashunit test tests/ --coverage --coverage-report-html coverage/html

Now the directory is optional with a sensible default:

# After: uses coverage/html by default
bashunit test tests/ --coverage-report-html

# Custom directory still works
bashunit test tests/ --coverage-report-html my-reports/

This reduces boilerplate and provides a consistent experience with other coverage options that have defaults.

🔖 Changes

  • Modified --coverage-report-html argument parsing to detect when no value or a flag is provided next
  • Defaults to coverage/html when no directory is specified
  • Updated documentation to reflect the optional [dir] parameter syntax
  • Updated help text in console header
  • Updated CHANGELOG with the new feature

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

  Allow using --coverage-report-html without specifying a directory,
  defaulting to coverage/html for convenience.
@Chemaclass Chemaclass added the enhancement New feature or request label Dec 21, 2025
@Chemaclass Chemaclass self-assigned this Dec 21, 2025
@Chemaclass Chemaclass added the enhancement New feature or request label Dec 21, 2025
Comment thread src/console_header.sh
--coverage-paths <paths> Source paths to track (default: auto-discover)
--coverage-exclude <pats> Patterns to exclude (comma-separated)
--coverage-report <file> Output file (default: coverage/lcov.info)
--coverage-report-html [dir] HTML report (default: coverage/html)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other parameters are with <>, is there any reason to use [] here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great question! I updated the docs to reflect the answer

Screenshot 2025-12-22 at 00 39 44

@Chemaclass Chemaclass merged commit c2cc519 into main Dec 21, 2025
16 checks passed
@Chemaclass Chemaclass deleted the feat/default-value-for-coverage-report-html branch December 21, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants