Exclusions
Planned interface
Section titled “Planned interface”When exclusions ship, they will be configured as a list of glob patterns under an exclude key in nolapse.yaml:
# Planned — not yet supportedlang: gowarn_threshold: -1.0fail_threshold: -3.0exclude: - "**/*_generated.go" - "internal/testdata/**" - "vendor/**"Patterns will follow standard glob syntax. Matched files will be omitted from the coverage calculation before nolapse compares against the baseline.
Current workarounds
Section titled “Current workarounds”Until exclusions are implemented, you can exclude files at the coverage tool level rather than at the nolapse level.
Go — build tags
Section titled “Go — build tags”Use a build tag to prevent test files or generated files from being instrumented:
//go:build ignoreOr use -coverpkg to limit which packages are measured:
go test -coverpkg=./internal/...,./pkg/... ./...You can also exclude specific packages by listing only the ones you want:
go test -coverprofile=coverage.out $(go list ./... | grep -v '/vendor/' | grep -v '/generated/')Go — coverage profile filtering
Section titled “Go — coverage profile filtering”After generating a coverage profile, strip unwanted lines before nolapse reads it:
go test -coverprofile=coverage.out ./...grep -v "_generated.go" coverage.out > coverage.filtered.outThen point nolapse at the filtered profile (exact flag name subject to change in future releases — check nolapse run --help).
Python — pytest --ignore
Section titled “Python — pytest --ignore”Use pytest --ignore to exclude directories from test collection and coverage measurement:
pytest --cov=src --ignore=src/generated --ignore=tests/fixturesOr add persistent ignores to pytest.ini / pyproject.toml:
[pytest]addopts = --ignore=src/generated[tool.pytest.ini_options]addopts = "--ignore=src/generated"Python — .coveragerc omit
Section titled “Python — .coveragerc omit”Use .coveragerc to omit paths from coverage reporting:
[run]omit = src/generated/* tests/fixtures/* **/conftest.pyOr in pyproject.toml:
[tool.coverage.run]omit = [ "src/generated/*", "tests/fixtures/*",]Tracking the feature
Section titled “Tracking the feature”The exclusions feature is tracked as a P1 item on the nolapse roadmap. When it ships, the exclude key will be added to the nolapse.yaml schema and this page will be updated with the full reference.