Linter aggregator for various data formats. All linters are preconfigured with common rules like duplicate blank lines, trailing whitespace and consistent indentation. In Markdown, it has third-party rules to check dead links and broken images.
| Runner | File type | Linter |
|---|---|---|
| Go | CSV |
csvlint
with RFC 4180 |
| Dockerfile |
Hadolint
with Docker Build Best Practices |
|
| GitHub Actions | actionlint | |
| Go Module | gomoddirectives | |
| Kubernetes | kube-linter | |
| LaTeX | ChkTeX | |
| Makefile | checkmake | |
| Properties | propertieslint | |
| Protobuf |
protolint
with Protobuf Style Guide |
|
| Shell | ShellCheck | |
| Terraform |
TFLint
with Terraform Style Guide |
|
| XML | libxml2 | |
| Python | Ansible | ansible-lint |
| AsciiDoc | AsciiDoc-Linter | |
| AWS CloudFormation | CloudFormation Linter | |
| Batch | Blinter | |
| Dotenv | dotenv-linter | |
| INI | PyINILint | |
| reStructuredText | restructuredtext-lint | |
| SQL |
SQLFluff
with Mozilla SQL Style Guide |
|
| TOML |
Taplo
with TOML Quick Tour |
|
| YAML |
yamllint
with YAML Best Practices |
|
| Node | Amazon State Language | asl-validator |
| CSS |
Stylelint
with Mozilla CSS Coding Guide |
|
| GraphQL | graphql-schema-linter | |
| HTML |
HTMLHint
with Mozilla HTML Style Guide |
|
| JSON | JSON Lint | |
| Lockfile | lockfile-lint | |
| Markdown |
markdownlint
with Adobe Markdown Basics |
|
| Mermaid | Maid | |
| Tekton | tekton-lint |
Several linters must be installed separatedly, preferably at OS level:
- ChkTeX
- Hadolint
- ShellCheck
- libxml2
Most linters are brought in as dependencies, others can be installed selectively.
go install github.com/hanggrian/stylebook@latest
go install github.com/checkmake/checkmake/cmd/checkmake@latest
go install github.com/terraform-linters/tflint@latestAll linters are brought in as optional dependencies, exclude the ones you don't need.
pip install "stylebook[ \
ansible-lint, \
asciidoc-linter, \
blinter, \
cfn-lint, \
dotenv-linter, \
pyinilint, \
sqlfluff, \
taplo, \
yamllint, \
restructuredtext-lint \
]"Most linters are brought in as optional dependencies, except for Stylelint,
which needs to be installed in the root package.json.
npm i @hanggrian/stylebook \
stylelint \
@stylistic/stylelint-plugin \
stylelint-config-recommended --save-devInsert target paths into the command. The program will recursively search for qualifying file types and spawn the corresponding linter processes.
stylebook . # Go binary
npx @hanggrian/stylebook some-folder/ some-file.sql
source .venv/bin/activate && stylebook **/*Configuration files are automatically picked up. If the file doesn't exist, the
program will use default configuration. If .stylebookrc exists in the root
project directory, it will be used as exclusion list.
