A linter which focuses on the low-level things that are common across many repositories. Leaves the language-specific linting to more appropriate tools.
I'm moving from pre-commit to lefthook, and don't want to have to deal with a Python installation and particular ways of needing to set up a virtualenv. So I'm rewriting the most relevant rules in Go so they can be compiled into a standalone binary.
Caution
This is a brand-new project and most of this isn't working yet. Check back later.
-
Pass files as arguments.
lint-brush [--flags] $(git ls-files -m)
-
Pipe a list of files.
git ls-files -m | lint-brush [--flags]
-
Pipe a list of files using
NUL
as the separator.git ls-files -m -z | lint-brush -0 [--flags]
Or all files in a directory, except for the Git directory (using fd)…
fd --unrestricted --exclude=.git --prune --type=file . | lint-brush [--flags]
Will be porting a number of checks from Python → Go for this effort.
- check: binary files should be stored in Git LFS
- check: executable text files should have shebangs
- check: find broken synlinks
- check: GitHub code links should be permalinks
- check: JSON/JSONC/JSON5 is well-formed
- check: large files added
- check: merge conflict markers
- check: problems with case-sensitive file systems
- check: TOML is well-formed
- check: XML is well-formed
- check: YAML is well-formed
- fix: destroyed symlinks
- fix: files should end with a final linebreak
- fix: mixed line endings
- fix: remove trailing whitespace on lines
- fix: remove UTF-8 BOM