Lint My Headers¶
Check source copyright and license headers across nine languages. Declare your policy, find issues, and refresh recognized stale years while preserving everything else.
What it does¶
- Nine languages: Python, JavaScript, TypeScript, Rust, Go, Swift, Bash, C, and C++.
- Read-only checks:
lmh checkreports what needs attention without writing source files. - Year-only repairs:
lmh fixupdates one recognized stale year for your configured owner.
Multilingual release
Version 0.7.0 provides all nine languages through native PyPI wheels. Select
languages in your policy; the default is Python. See the
installation options.
One year, one small diff¶
For a recognized header ending in 2025, lmh check reports LMH004. With source
changes authorized, run lmh fix to refresh the year in 2026:
-# Copyright (C) 2024-2025, Example Organization.
+# Copyright (C) 2024-2026, Example Organization.
The creation year, owner, and every other byte stay intact.
From policy to pull request¶
- Declare your policy. Set the owner, earliest creation year, license notice, and source paths.
- Run a check. Use
lmh checklocally, in CI, or from a coding agent. Review each finding. - Review the diff. Run
lmh fixfor eligible stale years, recheck, and inspect the changes.
Documentation¶
- Getting started: install the CLI, declare a first policy, and check your existing headers.
- Configuration: configuration files, language selectors, and header layouts.
- Integrations: pre-commit, prek, the GitHub Action, and an annual review workflow.
- Diagnostics & agents: findings, JSON output, and coding-agent repair boundaries.
- Performance: check overhead, full-codebase repair time, memory, and a reproducible HawkEye comparison.
Repair boundaries¶
Existing-header repairs preserve the creation year, body bytes, and file mode. Ambiguous layouts, unsafe links, and concurrently changed targets are refused. Missing headers without a creation year, wrong owners, malformed notices, and future years require manual review.
Ownership and licensing always come from your declared policy. Lint My Headers
does not establish legal, SPDX, or REUSE compliance. Published 0.7.0 does not
insert missing headers. The unreleased source can
insert a missing header with a declared creation year.
Both lmh and lint-my-headers expose the same commands, with no language
toolchain or Node.js runtime needed by the installed native CLI.
The project is licensed under Apache-2.0. Report an issue or read the contributor guide.