feat(cli): add per-check timing and total execution time - #140
Merged
Conversation
Adjust 7 tests that asserted empty output to filter out the "Completed in" timing line, keeping them compatible with the upcoming per-check timing feature.
14 tests covering per-check timing (verbose only), total execution time (unconditional), individual subcommand timing, format validation, and griffe skip guard.
Fix 5 code review findings: mock find_spec for hermetic tests, assert exact timing line counts, add elapsed value verification test, split compound assert, and extract _non_timing_lines() helper in test_cli.py. Mark story 20.2 and epic 20 as done.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds timing instrumentation to the docvet CLI to make check performance visible, aligning with Epic 20 / Issue #24 (timing output for checks).
Changes:
- Add per-check timing output for
docvet check(only when--verboseis set). - Add total execution time output (
Completed in …) forcheckand each individual subcommand. - Add/adjust unit tests to validate timing output and update “no output” assertions to ignore timing lines.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/docvet/cli.py |
Implements per-check and total timing output for check and total timing for each subcommand; adds griffe timing suppression when griffe is not installed. |
tests/unit/test_cli_timing.py |
New unit tests covering timing presence/absence, formatting, and griffe-installed vs not-installed behavior. |
tests/unit/test_cli.py |
Updates “no findings produces no output” assertions to ignore the new Completed in … line. |
_bmad-output/implementation-artifacts/sprint-status.yaml |
Updates sprint tracking status/metadata. |
_bmad-output/implementation-artifacts/20-2-per-check-timing-and-total-execution-time.md |
Adds story implementation record and AC-to-test mapping for Story 20.2. |
Remove _timing_lines() and _total_lines() — defined but never called. Tests use TIMING_LINE_RE.findall() directly.
Alberto-Codes
added a commit
that referenced
this pull request
Feb 26, 2026
🤖 I have created a release *beep* *boop* --- ## [1.4.0](v1.3.0...v1.4.0) (2026-02-26) ### Features * **ci:** add post-publish PyPI smoke test ([#134](#134)) ([5b89f3d](5b89f3d)) * **cli:** add per-check timing and total execution time ([#140](#140)) ([56c6c62](56c6c62)), closes [#24](#24) * **cli:** add progress bar for file processing ([#139](#139)) ([0f5e5dd](0f5e5dd)), closes [#24](#24) * **discovery:** add trailing-slash and double-star pattern support ([3696e6a](3696e6a)) * **discovery:** add trailing-slash and double-star pattern support ([#137](#137)) ([3696e6a](3696e6a)) * **docs:** add breadcrumb back-links to rule pages ([#136](#136)) ([17e985b](17e985b)) ### Bug Fixes * **docs:** remove redundant f-string in rule_header macro ([17e985b](17e985b)) ### Documentation * **cli:** add story 20.2 implementation record ([56c6c62](56c6c62)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Previously
docvet checkprovided no visibility into how long each checktook or total execution time, making it hard to identify slow checks or
understand overall performance.
--verboseis set (e.g.,enrichment: 42 files in 0.3s)Completed in 1.2s)Test:
uv run pytest -vCloses #24
test(cli): add timing unit tests and update no-findings tests
docs(cli): add story 20.2 implementation record
PR Review
Checklist
uv run pytest)uv run ruff check .)uv run ty check)!in title andBREAKING CHANGE:in bodyReview Focus
check()adds 4if verbose:blocks — linear, no nesting, CC stays well under 15importlib.util.find_spec("griffe")called in bothcheck()and_run_griffe— by design (timing wraps calls, doesn't modify_run_*bodies)_mock_check_internalsfixture mocksfind_specso tests don't depend on griffe being installedRelated