Skip to content

Common code formatters and linters in a single Nix flake

License

Notifications You must be signed in to change notification settings

evolutics/travel-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travel Kit 💼

Common code formatters and linters in a single Nix flake.

Installation

As a prerequisite, you need Nix to use this flake. You can integrate it into a flake as in this example. To use it ad hoc instead, run

nix run --no-write-lock-file github:evolutics/travel-kit -- [argument …]

Usage

To format your code and check for linting errors, simply run

# WARNING: this overwrites original files.
travel-kit

This affects all Git-tracked files in the current folder and its subfolders (recursively). Alternatively, you can pass specific paths to only affect those.

A non-zero exit status is returned if the formatting has been changed or there are linting errors.

To not apply certain tools, use the --skip option.

The --dry-run option shows what would be done without changing anything.

Related projects

Tools

The following tools are integrated:

  • Git diff check

    git diff --check 'HEAD^' -- *
  • Gitlint

    gitlint --ignore body-is-missing
  • Haskell Dockerfile Linter

    hadolint -- *.Dockerfile Dockerfile
  • HTMLHint

    htmlhint -- *.htm *.html
  • Jsonnet linter

    jsonnet-lint -- *.jsonnet *.libsonnet
  • Pylint

    pylint -- *.py
  • ShellCheck

    shellcheck -- *.sh
  • Stylelint

    stylelint -- *.css
  • treefmt

    treefmt --fail-on-change --no-cache --walk filesystem *.bazel *.bzl *.cjs *.clj *.cljc *.cljs *.cljx *.css *.html *.js *.json *.json5 *.jsonnet *.jsx *.libsonnet *.md *.mdx *.mjs *.nix *.py *.pyi *.rb *.scss *.sh *.tf *.toml *.ts *.tsx *.vue *.yaml *.yml *Vagrantfile