Changelog¶
All notable changes to go-crap will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v0.4.1 - 2026-06-18¶
Added¶
- Coverage unavailable warning — propagates
go testfailure messages through merge → score → formatters CoverageWarningfield onMergedEntryandCRAPEntry— set when coverage data is unavailable due to module-level test errorstableformatter: coverage column showsN/A ‼with deduplicated footer warning when coverage unavailablejsonformatter:coverageisnullandcoverage_warningfield populated when coverage unavailablegithubformatter: emits::warningannotation when coverage is unavailablesarifformatter: new result withRuleID: "go-crap/coverage-unavailable"when coverage unavailablepr-commentformatter: "Coverage Unavailable" section listing affected functions- Issue templates (bug report + feature request)
- Dependabot configuration
.golangci.ymlwith full linter configurationinternal/scan/entries.gowithEntryListtest helpers- Extensive test coverage across all packages
- Mutation testing robustness improvements across all internal packages
permissions: read-allto GitHub Actions workflow
Changed¶
- Refactored
cmd/scan.gooutput pipeline to use config struct - Refactored
internal/scan/scan.gowithOptionsstruct and helper extraction - DRY refactors across internal packages
- Dead code removal
- Doc comment cleanup across internal packages
- Bumped golangci-lint config version to v1.65.0
- Bumped golangci-lint-action from v6 to v9
- Removed dead code in
pkg/sloggerandpkg/dummylogger
Fixed¶
crappy[:25]slice bounds panic when filtered entries < 25 items- Linting issues across codebase
- Typo
ThresholdExeeded→ThresholdExceeded - Typo in version command description ("TestGen" → "go-crap")
- Logic bugs in merge, score, mutation, report, and scan packages
- Typos and embarrassment fixes across codebase
v0.4.0 - 2026-06-08¶
Added¶
- New
--mutation-reportflag — path to a gremlins JSON mutation report to validate coverage reliability - New
internal/mutationpackage — parses gremlins mutation reports and annotates CRAP entries - New
CoverageUntrustedfield onCRAPEntry— set totruewhen lived mutants are found in a function - New
MutationScorefield onCRAPEntry— killed/(killed+lived) ratio for the function - New
EffectiveCRAPfield onCRAPEntry— CRAP score recalculated with 0% coverage whenCoverageUntrustedistrue - Mutation score included in JSON output (
mutation_score,coverage_untrusted,effective_crapfields) - Coverage warning flag (⚠) in
tableandpr-commentformatters when coverage is unreliable - Coverage-untrusted warnings in
githubandsarifformatters (SARIF adds a secondcoverage-untrustedresult) - New "Unreliable Coverage" section in
pr-commentoutput listing affected functions with mutation scores - New
--detailedflag — includes mutation failure details (original/replacement code, line, type) in report output - New
MutationDetailstruct onCRAPEntry— stores survived mutant details when mutation report is provided - JSON output includes
mutation_detailsarray per entry when--detailedis set, withtype,mutator_name,file,line,status,original_text, andreplacement_textfields - SARIF appends survived mutation details (type, line, code diff) to warning messages when
--detailed - PR Comment adds
Survived Mutantscolumn with code snippets when--detailed - New
OriginalCodeandReplacementCodefields on mutationMutantstruct, parsed from Gremlins JSON report
Changed¶
ThresholdExceeded()now usesEffectiveCRAPinstead ofCRAPfor threshold comparison- Filtering (
--top,--min) and sorting now useEffectiveCRAPwhen mutation report is provided --fail-abovenow checksEffectiveCRAPagainst the threshold
Fixed¶
- Functions with lived mutants now show their true risk level via
EffectiveCRAP(CRAP at 0% coverage)
v0.3.0 - 2026-06-05¶
Added¶
- New
sarifoutput format — SARIF 2.1.0 compliant JSON for static analysis tools - New
pr-commentoutput format — markdown table formatted for pull request comments - New
--verboseflag — enables debug-level logging viapkg/loggerandpkg/slogger - New
--output/-oflag — write output to a file instead of stdout
v0.2.0 - 2026-06-04¶
Added¶
- New
internal/scanpackage — unified scan pipeline orchestrating coverage, complexity, merge, and score in a single call - New
pkg/utilspackage withBuildExcludeRegexandMatchExcludehelpers - Method receiver tracking — CRAP entries now include receiver info for struct methods
EntryListwrapper type withThresholdExceeded()method for CI integrationSkippedfield onCRAPEntryfor functions excluded by--missing skippolicy- JSON output now uses
EntryListstructure with optional receiver field
Changed¶
--excludeflag now uses regex matching instead of glob matching- Refactored
cmd/scan.goto use newinternal/scanpackage - Coverage and complexity packages now accept
*regexp.Regexpinstead of[]stringfor exclude patterns - Merge now constructs full function names from receiver + method name
- Report formatters now accept
*score.EntryListinstead of[]score.CRAPEntry - GitHub formatter now includes function name (and receiver for methods) in warning messages
Fixed¶
- Properly match function names with method receivers (e.g.
(*MyType).Method) - Handle zero-coverage entries correctly in merge step
runCoverToolnow runs in correct module directory (modDirset ascmd.Dir)- Correct coverage path matching in CI environments —
buildSuffixnow uses 3 path components instead of 2, bridging Go module paths (github.com/.../file.go) and absolute filesystem paths (/home/runner/.../go-crap/file.go) - Fix
normalizeFuncNamefailing to strip value-receiver prefixes — methods likeLevel.StringorLogger.Debugwere not matched against coverage data, causing false 0% coverage reports for all value-receiver methods - Fix merge discarding 0% coverage as "missing" — functions with known 0% coverage (coverage data present but no statements executed) are now correctly distinguished from functions with no coverage data at all
v0.1.0 - 2026-06-02¶
Added¶
- Initial release of go-crap
scancommand — analyze Go modules and calculate CRAP scores- AST-based cyclomatic complexity via
internal/complexity(adapted from gocyclo, BSD-3-Clause) - Coverage profiling via
internal/coverage(adapted from test-finder, MIT) - Double-index merge — joins coverage and complexity by
(filepath, funcname)without CWD path resolution issues - CRAP formula —
CC² × (1 - coverage/100)³ + CC - Missing coverage policy —
pessimistic(default),optimistic,skip - Output formatters:
table— human-readable with status symbols (✓, ▲, ✗) and coverage barsjson— structured output with schema URLgithub— GitHub Actions workflow annotation format- Filtering —
--top N,--min score,--exclude glob - CI integration —
--fail-aboveexits with code 1,--format githubproduces workflow annotations - GitHub Actions CI/CD workflow (tests + CRAP check)
- GitHub Pages documentation deployment