Skip to content

hanggrian/stylebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions Codecov Renovate
GitHub Release PyPI TestPyPI NPM
Go Python Node

Stylebook

The Stylebook logo.

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

View rules

Download

Several linters must be installed separatedly, preferably at OS level:

  • ChkTeX
  • Hadolint
  • ShellCheck
  • libxml2

Go

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@latest

PyPI

All 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 \
]"

NPM

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-dev

Usage

CLI screenshot

Insert 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

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.

About

Comprehensive linter aggregator for data and tooling formats

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors