feat: add git integration for incremental validation (#36) - #43
Merged
Conversation
Adds comprehensive git integration features for faster validation: - GitUtils class for git operations and repository management - ValidationCache system with content-based invalidation and TTL - Enhanced validate command with git-aware options - Support for --git-diff, --git-staged, --cache, --fail-fast modes - CLI integration with new performance options - Comprehensive test coverage for git operations and caching Enables efficient incremental validation by only checking changed files and caching validation results for faster subsequent runs.
… reality The branch never passed its own CI: its tests mocked execSync with Buffer returns where the utf8-encoded call yields strings, queued mock sequences that assumed an uncached repository root, modeled detached HEAD as a thrown error, and permanently replaced mock implementations that vi.clearAllMocks does not restore. The scaffolding now builds default instances through vi.hoisted and restores them per test. ValidationResult is defined in the cache module (the phantom import from types/operations never existed) and now carries hasExternalLinks, which turns the two "for now assume" stubs into real logic: link counting reads totalLinks and the TTL gate only re-checks entries that actually had external links. Cache reads degrade to a miss on error instead of skipping the file, cache statistics surface through gitInfo even without git integration, renames parse their three-field git output correctly, the repository root is resolved once per diff/ls operation before the command runs, and wrapped errors carry causes.
Mearman
force-pushed
the
feature/issue-36-git-integration
branch
from
August 21, 2026 14:40
a24c8bf to
a13bc2e
Compare
The remaining test mocks cast scenario instances to any, which pushed the lint warning count past the --max-warnings 20 cap; they now cast to the classes they stub. GitUtils assertions compared resolve() output against POSIX paths, which only holds on unix: resolved paths are normalised to forward slashes before asserting, matching the convention the rest of the suite uses for globs.
Slashes alone were not enough: on Windows, resolve() anchors the mocked POSIX repository root to the current drive, so expectations carry the D: prefix. The expected base is now computed once with resolve() itself, keeping the assertions honest on every platform.
Member
Author
|
🎉 This PR is included in version 1.33.0 🎉 The release is available on:
Installationnpm install -g markmv@1.33.0Security & Supply Chain✅ OIDC Trusted Publishing: published from CI with no long-lived npm token Test CoverageThis release includes comprehensive test coverage reports. View coverage details in the release assets. Your semantic-release bot 📦🚀 |
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
Key Features
Implementation Details
Test Coverage
Performance Impact
Resolves #36