LogoLogo
SlackLogin
  • Overview
    • Welcome
  • Setup & Configuration
    • Connecting to Trunk
    • Managing Your Organization
      • GitHub App Permissions
  • Integration with Slack
  • Flaky Tests (Beta)
    • Overview
    • Get Started
      • Test Frameworks
        • Android
        • Bazel
        • Behave
        • cargo-nextest
        • Cypress
        • Dart Test
        • Go
        • GoogleTest
        • Gradle
        • Jasmine
        • Jest
        • Karma
        • Maven
        • minitest
        • Mocha
        • Nightwatch
        • NUnit
        • Pest
        • PHPUnit
        • Playwright
        • Pytest
        • Robot Framework
        • RSpec
          • RSpec (Manual Uploads)
        • Swift Testing
        • Vitest
        • XCTest
        • Other Test Frameworks
      • CI Providers
        • Azure DevOps Pipelines
        • BitBucket Pipelines
        • Buildkite
        • CircleCI
        • Drone CI
        • GitHub Actions
        • GitLab
        • Jenkins
        • Semaphore CI
        • TeamCity
        • Travis CI
        • Other CI Providers
    • Dashboard
    • Flaky Test Detection
    • Quarantining
    • PR Comments
    • Ticketing Integrations
      • Jira Integration
      • Linear Integration
      • Other Ticketing Platforms
    • Webhooks
      • Slack Integration
      • Microsoft Teams Integration
      • GitHub Issues Integration
      • Linear Integration
    • Uploader CLI Reference
  • Merge Queue
    • Overview
    • How does it work?
    • Setup
      • Quick Start
      • Settings
      • Integration for Slack
    • Concepts and Optimizations
      • Predictive Testing
      • Optimistic Merging
      • Pending Failure Depth
      • Anti-Flake Protection
      • Batching
      • Parallel Queues
        • Bazel
        • Nx
        • API
      • FAQ
    • Priority
    • Managing Merge Queue
      • Using the Merge UI
      • Metrics
      • Command Line
    • Webhooks
    • Reference
  • Code Quality
    • Overview
    • Why Metalinters?
      • How does it work?
      • Why Code Quality?
    • Setup & Installation
      • Initialize Trunk
      • Local Linting
      • Linting in CI
      • Nightly Report (Deprecated)
    • IDE Integration
      • VSCode
      • Neovim
      • GitHub Codespaces
    • Linters
      • Supported Linters
        • Actionlint
        • Ansible-lint
        • Autopep8
        • Bandit
        • Biome
        • Black
        • Brakeman
        • buf
        • Buildifier
        • cfnlint
        • Checkov
        • circleci
        • ClangFormat
        • clang-tidy
        • Clippy
        • cmake-format
        • codespell
        • cspell
        • cue-fmt
        • dart
        • deno
        • Detekt
        • djlint
        • dotenv-linter
        • dotnet-format
        • dustilock
        • ESLint
        • Flake8
        • git-diff-check
        • Gitleaks
        • Gofmt
        • gofumpt
        • goimports
        • gokart
        • golangci-lint
        • golines
        • google-java-format
        • graphql-schema-linter
        • hadolint
        • haml-lint
        • isort
        • iwyu
        • ktlint
        • kube-linter
        • markdown-link-check
        • markdown-table-prettify
        • Markdownlint
        • markdownlint-cli2
        • mypy
        • nancy
        • nixpkgs-fmt
        • opa
        • OSV-Scanner
        • Oxipng
        • perlcritic
        • perltidy
        • php-cs-fixer
        • phpstan
        • pmd
        • pragma-once
        • pre-commit-hooks
        • Prettier
        • prisma
        • psscriptanalyzer
        • Pylint
        • pyright
        • regal
        • remark-lint
        • renovate
        • rome
        • rubocop
        • Ruff
        • rufo
        • rustfmt
        • scalafmt
        • semgrep
        • ShellCheck
        • shfmt
        • sort-package-json
        • sourcery
        • sql-formatter
        • SQLFluff
        • sqlfmt
        • squawk
        • standardrb
        • stringslint
        • stylelint
        • stylua
        • SVGO
        • swiftformat
        • swiftlint
        • taplo
        • Terraform
        • terragrunt
        • terrascan
        • TFLint
        • tfsec
        • tofu
        • Trivy
        • Trufflehog
        • txtpbfmt
        • vale
        • Yamllint
        • yapf
      • Run Linters
      • Manage Linters
      • Configure Linters
      • Ignoring Issues and Files
      • Custom Linters
      • Shared Configs
      • Upgrades
    • Debugging
    • Licensing
  • CLI & API References
    • CLI Reference
      • Install
      • Getting Started
        • Code Quality
        • Merge Queue
        • Flaky Tests
        • Tools
        • Actions
          • Git Hooks
        • Announce
      • Compatibility
      • Caching
      • Commands Reference
        • Code Quality
        • Actions
        • Merge
      • Configuration
        • Plugins
          • Share Config Between Codebases
          • Exporting Linter Configs
        • Runtimes
        • Tools
        • Lint
          • Definitions
          • Commands
          • Output
          • Output Parsing
          • Files and Caching
          • Dependencies
          • Auto-Enable
        • Actions
          • Notifications
          • Logging and Troubleshooting
        • Merge
        • Telemetry
        • Per User Overrides
    • API Reference
      • Flaky Tests
      • Merge Queue
      • Webhooks Reference
  • Pricing & Security
    • Security
  • Billing
  • Community & Support
  • Links
    • Open App
    • Slack Community
    • Changelog
    • Feature Requests
On this page
  • Why Aren't Issues Showing up Anymore?
  • My Linters Are Failing or Not Running as Expected
  • Why Does Trunk Take up So Much Disk Space?
  • How do I Make a Linter Work with a Different File Type?
  • How can I Disable Trunk on a Commit for just Me, but Keep it on for the Rest of my Team?
  • What Should I do if a Linter Process Seems to Take Longer than Expected During a Trunk Check?
  • trunk init says "Trunk can only init if it's run at the root of a git repo"
Edit on GitHub
  1. Code Quality

Debugging

Last updated 4 months ago

Why Aren't Issues Showing up Anymore?

If you aren’t seeing any issues the likely cause is that your local repo is clean. By default Trunk Code Quality only processes new changes to your codebase (read about ).

You can use trunk check to scan for older, pre-existing lint issues.

For example, to look at a sampling of each linter's issues for 5 random files:

trunk check --samples=5 

You can also scan all files using --all:

trunk check --all

.

My Linters Are Failing or Not Running as Expected

When your linters aren’t working the way you expect, first check their configuration. Trunk’s provides some specific tips for certain linters. You can see the full default configuration of every linter in .

You can also try running trunk check --verbose to see what’s going on under the hood. If that still doesn’t work then please reach out to us on with the output of trunk check --verbose.

Why Does Trunk Take up So Much Disk Space?

Trunk Code Quality uses hermetically versioned tools, which means it downloads a separate copy of the tools and runtime for each tool version. Over time, as tools are upgraded, this can leave a lot of unnecessary files in the cache directory. Trunk is working on a way to automatically remove unneeded files from the cache. In the meantime, you can safely clear your cache with

trunk cache clean --all

then run trunk install again in your repos.

How do I Make a Linter Work with a Different File Type?

Suppose you are using the foo-linter which normally runs on foo files. The config might look like this:

lint:
  files:
    - name: foo
      extensions: [foo]
  definitions:
    - name: foo-linter
      files: [foo]
      commands:
        - name: lint
          output: pass_fail
          run: echo “foo”
          success_codes: [0, 1]

To add support for bar files add this to your trunk.yaml file. The first part defines the bar file type, and the second says that foo-linter uses both foo and bar files.

lint:
  files:
    - name: bar
      extensions: [bar]
...
      
  definitions:
    - name: foo-linter
        files:
          - foo
          - bar

How can I Disable Trunk on a Commit for just Me, but Keep it on for the Rest of my Team?

If you prefer to never run Trunk on commit and push you can disable it just for you. Edit or create the .trunk/user.yaml file and change the actions.disabled section to look like this:

version: 0.1
actions:
  disabled:
    - trunk-check-pre-push
    - trunk-fmt-pre-commit
  

This will disable the checks for just the current user. The .trunk/user.yaml file is specifically gitignored but will be loaded locally if present.

What Should I do if a Linter Process Seems to Take Longer than Expected During a Trunk Check?

There are two main strategies to address this issue: configuring timeouts and ignoring certain files.

Timeout Configuration

Each linter integrated with Trunk Code Quality has a default timeout of 10 minutes to prevent processes from running indefinitely. If a linter exceeds this time frame, Trunk Code Quality will automatically terminate the process and notify you of the timeout.

To adjust the timeout duration for a specific linter, you can modify its run_timeout setting in your configuration. For example:

lint:
    definitions:
    - name: clang-tidy
      run_timeout: 5m

Ignoring Files

Certain files, particularly those that are auto-generated, may not require linting and can significantly extend the duration of checks. To exclude these from being checked, use the ignore key in your configuration:

lint:
  ignore:
    - linters: [ALL]
      paths:
        # Ignore generated files
        - src/generated/**
        # Except for files ending in .foo
        - !src/generated/**/*.foo # Test data
        - test/test_data

trunk init says "Trunk can only init if it's run at the root of a git repo"

Trunk requires that you run trunk init from the root of a git repository. Trunk is git-aware, and relies on git to understand which files are modified, gitignored, and more.

If you see this message, it means that you are not in the root directory of a git repository. If you are in a git worktree, Trunk does support worktrees. Your worktree may be in a broken state, try running git worktree repair and then trunk init again.

Every linter defines a set of file types that it wants to work with in a section of the YAML called files. To change this you need to override the files section of that linter’s definition. .

Timeouts can be specified using s for seconds, m for minutes, or h for hours, allowing you to tailor the behavior to your project's needs. More on .

This approach lets you specify which linters to ignore for particular paths, optimizing the check process and focusing on relevant files. .

More details on ignoring files
list of supported linters
Trunk’s public plugin repo
our community Slack
Read our docs for more information on CLI options
More linter application file types
hold-the-line
linter timeouts