There are two ways to exclude files from coverage in Qlty:Documentation Index
Fetch the complete documentation index at: https://docs.qlty.sh/llms.txt
Use this file to discover all available pages before exploring further.
- In your coverage tool — exclude files before the coverage report is generated
- In
qlty.toml— filter files out of coverage data during upload
qlty.toml is often the simpler option.
Excluding files in your coverage tool
Each coverage tool has its own configuration for excluding files. Below are examples for common tools.JavaScript / TypeScript (Jest / Istanbul)
JavaScript / TypeScript (Jest / Istanbul)
Configure coverage exclusions in your Jest config (
jest.config.js or package.json):collectCoverageFrom: Specify which files to include (use!to exclude patterns)coveragePathIgnorePatterns: Exclude files matching these patterns
.nycrc or package.json:Python (pytest-cov / coverage.py)
Python (pytest-cov / coverage.py)
Configure exclusions in your Or in You can also exclude specific lines or blocks using inline comments:
pyproject.toml, setup.cfg, or .coveragerc:.coveragerc:Ruby (SimpleCov)
Ruby (SimpleCov)
Configure exclusions in your test helper where SimpleCov is initialized:
add_filter accepts strings, regex patterns, or blocks.Java / Kotlin (JaCoCo)
Java / Kotlin (JaCoCo)
Configure exclusions in your build file.Gradle:Maven:
Go
Go
Go’s built-in coverage tool uses build tags and package patterns to control coverage scope:
PHP (PHPUnit)
PHP (PHPUnit)
Configure coverage exclusions in
phpunit.xml:Swift (Xcode / Slather)
Swift (Xcode / Slather)
When using Slather, configure exclusions in When using
.slather.yml:xccov, exclusions must be configured at the Xcode scheme level or by post-processing the coverage data before uploading.Elixir (lcov_ex)
Elixir (lcov_ex)
In Elixir, configure which modules to exclude from coverage in
mix.exs:Excluding files in qlty.toml
You can also exclude files from coverage using the[coverage].ignores setting in qlty.toml. When qlty coverage publish runs, any file path in the coverage report that matches an ignore pattern is dropped before uploading.
Built-in default exclusions
Qlty applies a set of defaultexclude_patterns that automatically propagate to coverage ignores. These include paths like:
[coverage].ignores are combined with these defaults.
Using exclude_patterns for coverage
The top-levelexclude_patterns setting in qlty.toml automatically propagates to [coverage].ignores. This means any pattern in exclude_patterns also excludes files from coverage.
Removing missing files
If your coverage report contains paths for files that don’t exist on disk (e.g., generated during CI but not checked in), you can drop them during upload:Common files to exclude
Depending on your project, you may want to exclude:- Generated code: API clients, protobuf files, GraphQL types
- Vendor/third-party code: Dependencies copied into your repository
- Configuration files: Setup, bootstrap, or configuration modules
- Migration files: Database migration scripts
- Test utilities: Test helpers, fixtures, and factories
See Also
- Generating Coverage Data for language-specific setup
- Excluding Files from Analysis for static analysis exclusions (separate from coverage)
- Unexpected Coverage Changes for troubleshooting coverage differences