Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to KeyHog. Versions follow [Semantic Versioning](https://semver.org/).

## Unreleased

### Fixed

- Restored workspace `cargo check --all-targets` in non-Git-LFS checkouts by replacing three historical scanner diagnostic test targets that had been committed as raw Git LFS pointers with compiling ignored placeholders. Added a scanner contract that fails with a clear message if a top-level Rust test target is ever checked in as an LFS pointer again.

## 0.5.40 - 2026-06-04

### Fixed
Expand Down
1 change: 1 addition & 0 deletions crates/scanner/tests/contract/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod readme_detector_count;
pub mod rust_test_sources_are_not_lfs_pointers;
pub mod verify_api_count_band;
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//! Contract: Rust test targets must be real Rust source, not Git LFS pointers.

use std::path::PathBuf;

fn scanner_tests_dir() -> PathBuf {
let mut dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
dir.push("tests");
dir
}

#[test]
fn rust_test_sources_are_not_lfs_pointers() {
let tests_dir = scanner_tests_dir();
let mut pointer_files = Vec::new();

for entry in std::fs::read_dir(&tests_dir).expect("scanner tests directory readable") {
let entry = entry.expect("scanner tests directory entry readable");
let path = entry.path();
if path.extension().and_then(|ext| ext.to_str()) != Some("rs") {
continue;
}

let source = std::fs::read_to_string(&path).unwrap_or_else(|e| {
panic!("failed to read Rust test source {}: {e}", path.display())
});
if source.starts_with("version https://git-lfs.github.com/spec/v1") {
pointer_files.push(path);
}
}

assert!(
pointer_files.is_empty(),
"Rust test files must not be Git LFS pointers: {:?}",
pointer_files
);
}
12 changes: 9 additions & 3 deletions crates/scanner/tests/diagnose_84_divergence.rs
Git LFS file not shown
13 changes: 10 additions & 3 deletions crates/scanner/tests/diagnose_sb_divergence.rs
Git LFS file not shown
12 changes: 9 additions & 3 deletions crates/scanner/tests/readme_claims.rs
Git LFS file not shown
1 change: 0 additions & 1 deletion crates/sources/src/git/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,3 @@ fn stream_added_lines(
}
}))
}

Loading