README.md

April 28, 2026 ยท View on GitHub

Trunk.io

docs contributing testing guide slack vscode openssf

Welcome

This repository is the official Trunk.io repo containing Trunk's integrations for linters, formatters, security tools, githooks, and default configs. By default, all Trunk users import this repo as a plugin, via this snippet in .trunk/trunk.yaml:

plugins:
  sources:
    - id: trunk
      uri: https://github.com/trunk-io/plugins
      ref: v1.5.0

This repo is open to contributions! See our contribution guidelines and join our slack community for help. If you're adding new tools, please see our testing guide as well!

Supported Linters, Formatters, and Security Tools

Enable the following tools via:

trunk check enable {linter}
TechnologyLinters
Allcodespell, cspell, gitleaks, git-diff-check, ls-lint, pre-commit-hooks, trunk-toolbox, vale
Ansibleansible-lint
Apexpmd
Bashshellcheck, shfmt
Bazel, Starlarkbuildifier
C, C++clang-format, clang-tidy, include-what-you-use, pragma-once
C#dotnet-format
CircleCI Configcircleci
Cloudformationcfnlint, checkov
CMakecmake-format
CSS, SCSSstylelint, prettier
Cuecue-fmt
Dartdart
Dockerhadolint, checkov
Dotenvdotenv-linter
GitHubactionlint
Gogofmt, gofumpt, goimports, gokart, golangci-lint, golines, semgrep
GraphQLgraphql-schema-linter, prettier
HAMLhaml-lint
HTML Templatesdjlint
Javagoogle-java-format, pmd, semgrep
Javascriptbiome, deno, eslint, prettier, rome, semgrep
JSONbiome, deno, eslint, prettier, semgrep
Kotlindetekt, ktlint
Kuberneteskube-linter
Luastylua
Markdowndeno, markdownlint, markdownlint-cli2, markdown-link-check, markdown-table-prettify, prettier, remark-lint, [rumdl]
Nixnixpkgs-fmt
package.jsonsort-package-json
Perlperlcritic, perltidy
PHPphp-cs-fixer, phpstan
PNGoxipng
PowerShellpsscriptanalyzer
Prismaprisma
Protobufbuf (breaking, lint, and format), clang-format, clang-tidy
Pythonautopep8, bandit, black, flake8, isort, mypy, nbstripout, pylint, pyright, semgrep, yapf, ruff, sourcery, ty
Regoregal, opa
Renovaterenovate
Rubybrakeman, rubocop, rufo, semgrep, standardrb
Rustclippy, rustfmt
Scalascalafmt
Securitycheckov, dustilock, grype, nancy, osv-scanner, snyk, tfsec, trivy, trufflehog, terrascan
SQLsqlfluff, sqlfmt, sql-formatter, squawk
SVGsvgo
Swiftstringslint, swiftlint, swiftformat
Terraformterraform (validate and fmt), checkov, tflint, tfsec, terrascan, tofu
Terragruntterragrunt
Textprototxtpbfmt
TOMLtaplo
Typescriptdeno, eslint, prettier, rome, semgrep
YAMLprettier, semgrep, yamlfmt, yamllint

Supported Trunk Actions

You can think of Trunk Actions as IFTTT for your repository. An action is a command that is run in reaction to a specified trigger. Triggers can be git-hooks, file modifications, time-based, or manually run. See docs for more details.

Enable trunk actions via:

trunk actions enable {action}
actiondescription
buf-genrun buf on .proto file change
commitizenenforce conventional commits and manage releases
commitlintenforce conventional commit message for your local commits
go-mod-tidyautomatically tidy go.mod file
go-mod-tidy-vendorautomatically tidy and vendor go.mod file
git-blame-ignore-revsautomatically configure git to use .git-blame-ignore-revs
npm-checkcheck whether NPM installation is up to date
terraform-docsgenerate documentation from Terraform modules
poetry-check, poetry-lock, poetry-export, poetry-installhooks to enforce poetry configuration
yarn-checkcheck whether Yarn installation is up to date

Supported Tools

This repository also defines configuration for Trunk Tools, which provides hermetic management of different CLI tools. You can run trunk tools list to view all supported tools. Check out our docs.

Mission

Our goal is to make engineering faster, more efficient and dare we say - more fun. This repository will hopefully allow our community to share ideas on the best tools and best practices/workflows to make everyone's job of building code a little bit easier, a little bit faster, and maybe in the process - a little bit more fun. Read more about Trunk Check.

Additional Reference

Some linters provide built-in formatters or autofix options that don't always produce ideal outputs, especially in conjunction with other formatters. Trunk supports defining autofix options for these linters, but has their formatting turned off by default. An example of this is sqlfluff:

- name: sqlfluff
  files: [sql, sql-j2, dml, ddl]
  runtime: python
  package: sqlfluff
  direct_configs:
    - .sqlfluff
  commands:
    - name: lint
      run: sqlfluff lint ${target} --format json --dialect ansi --nofail
      output: sarif
      success_codes: [0]
      read_output_from: stdout
      parser:
        runtime: python
        run: ${plugin}/linters/sqlfluff/sqlfluff_to_sarif.py
    - name: fix
      run: sqlfluff fix ${target} --dialect ansi --disable-progress-bar --force
      output: rewrite
      formatter: true
      in_place: true
      success_codes: [0]
      enabled: false

The fix subcommand has enabled: false, so when you run trunk check enable sqlfluff, only the lint subcommand is enabled. To override this behavior, specify in your trunk.yaml:

lint:
  enabled:
    - sqlfluff@<version>:
        commands: [lint, fix]