linter
An unopinionated1, lightweight2 Docker image to lint all-the-things3!
- No specific style enforced, this can be configured in your project.
- Well, ~145 MB, because some linters need node.js, which is ~100 MB.
- That is,
- things common to most software projects -- shell scripts,
Dockerfile
s,Makefile
s,*.md
files, etc. - things not language-specific -- this is better done in either a language-specific linter image, or directly in your project's build image, which typically already has the targeted language's toolchain.
- things common to most software projects -- shell scripts,
Supported linters
Language | Linter |
---|---|
Dockerfile | hadolint |
English | misspell |
Makefile | checkmake |
Markdown | markdownlint |
Shell | shellcheck , shfmt , +x bit check |
Usage
Lint all-the-things
The following command will lint all files in the mounted directory using
bin/lint
:
docker run -v $(pwd):/mnt/lint marccarre/linter:latest
Lint just one thing
You can also directly run a specific sub-linter:
docker run -v $(pwd):/mnt/lint marccarre/linter:latest hadolint Dockerfile
Inspirations
- GitHub'
super-linter
, which I found good, but unwieldy and bloated.