| Crates.io | fast-license-checker |
| lib.rs | fast-license-checker |
| version | 0.1.0 |
| created_at | 2026-01-01 02:43:35.525487+00 |
| updated_at | 2026-01-01 02:43:35.525487+00 |
| description | Blazing-fast license header verification for your codebase |
| homepage | |
| repository | https://github.com/zippyzappypixy/fast-license-checker.git |
| max_upload_size | |
| id | 2015656 |
| size | 3,480,314 |
Blazing-fast license header verification for your codebase.
cargo install fast-license-checker
Download from Releases
flc . # Scan current directory
flc src/ # Scan specific directory
flc --header "MIT License" . # Specify header text
flc --license LICENSE.txt . # Specify header from file
flc --output json . # JSON output for CI
flc --output github . # GitHub Actions annotations
flc --fix . # Add headers to files missing them
flc --fix --dry-run . # Preview changes without applying
# Custom comment styles
flc --comment-style "rs=//" --comment-style "py=#" .
# Ignore additional patterns
flc --ignore "target/" --ignore "node_modules/" .
# Control parallelism
flc --jobs 4 . # Use 4 CPU cores
flc --jobs 1 . # Single-threaded for debugging
# Fuzzy matching for license variations
flc --similarity 85 . # Allow 85% similarity threshold
Create .license-checker.toml in your project root:
license_header = """
Copyright (c) 2024 Your Name
Licensed under the MIT License
"""
[comment_styles]
rs = { prefix = "//" }
py = { prefix = "#" }
js = { prefix = "//" }
html = { prefix = "<!--", suffix = "-->" }
xml = { prefix = "<!--", suffix = "-->" }
yaml = { prefix = "#" }
toml = { prefix = "#" }
md = { prefix = "<!--", suffix = "-->" }
ignore_patterns = ["vendor/", "generated/", "target/", "node_modules/"]
max_header_bytes = 8192
parallel_jobs = 0 # 0 = auto-detect CPU cores
similarity_threshold = 90 # 0-100, higher = stricter matching
0: All files have valid headers (scan) or fixes applied successfully (fix)1: Missing headers found (scan) or errors encountered (fix)2: Configuration error or invalid argumentsFast License Checker is designed for speed. On a modern laptop:
| Workload | Time | Notes |
|---|---|---|
| 1K files | 6ms | Baseline overhead |
| 10K files | 51ms | Typical small project |
| 100K files | 424ms | Large codebase ✅ |
# Install criterion
cargo install cargo-criterion
# Run benchmarks
cargo bench -- scan
# View HTML report
open docs/benchmarks/index.html
Note: First run is slower due to disk cache warming. Results shown are from second run (warm cache).
// comments# comments// comments// comments// or /* */ comments// or /* */ comments<!-- --> comments# comments# comments<!-- --> comments# commentsFor unsupported file types, define custom comment styles:
[comment_styles]
custom = { prefix = "/*", suffix = "*/" } # Block comments
lua = { prefix = "--" } # Lua line comments
- name: Check license headers
uses: zippyzappypixy/fast-license-checker@v0.1.0
with:
path: '.'
header: 'Copyright (c) 2024 My Company'
fix: false # Set to true to auto-fix
- name: Annotate PR
run: flc --output github .
license-check:
script:
- curl -L https://github.com/zippyzappypixy/fast-license-checker/releases/latest/download/flc-linux-x86_64 -o flc
- chmod +x flc
- ./flc --output json . > license-report.json
artifacts:
reports:
license_scanning: license-report.json
pipeline {
agent any
steps {
sh '''
curl -L https://github.com/zippyzappypixy/fast-license-checker/releases/latest/download/flc-linux-x86_64 -o flc
chmod +x flc
./flc --output json . > license-report.json
'''
publishCoverage adapters: [jacocoAdapter(path: 'license-report.json')]
}
}
git clone https://github.com/zippyzappypixy/fast-license-checker
cd fast-license-checker
cargo build --release
cargo test --workspace # Run all tests
cargo bench # Run benchmarks
cargo test --doc # Test documentation examples
cargo fmt --all -- --check # Check formatting
cargo clippy -- -D warnings # Strict linting
cargo deny check # Security audit
cargo llvm-cov --workspace # Code coverage
git checkout -b feature/amazing-featurecargo fmt && cargo clippy && cargo testgit commit -m 'Add amazing feature'git push origin feature/amazing-featureLicensed under MIT OR Apache-2.0 (choose one that fits your project).
This tool is dual-licensed to maximize compatibility with your codebase.