chore: update slophammer to v0.3.0 and deduplicate flagged blocks#20
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI ran slophammer with
@latest, so the 0.2.0 config cutover was about to break every run, and the old flatslophammer.ymlkeys are now a hard config error.This change pins slophammer to v0.3.0, migrates the config to the nested shape, and makes the gates actually count: 0.3.0 only credits CI steps scoped to the Go module, so the slophammer steps now run from
backend/with the dedicatedslophammer-gobinary.The newer DRY engine also found three real copied blocks that the old version missed; they are deduplicated here so the gate passes honestly instead of being raised.
What Changed
The slophammer wiring moved to the current release, and the code it flagged was cleaned up.
slophammer.yml: flat 0.1.x keys (coverage_threshold,dry_max_candidates,dry_paths,crap_max_score,mutation_targets) migrated to the nested shape (coverage.threshold,dry.max_findings/paths/exclude,crap.max_score,mutation.targets). Boundaries unchanged.cmd/slophammer@latest→cmd/slophammer-go@v0.3.0, withworking-directory: backendand..as the check root. 0.3.0's binding-evidence rules only credit steps reachable from the Go module, so the old root-level umbrella invocations no longer counted as enforcement.internal/translation/manager.go: the article title/text task construction existed twice; both sites now use oneappendArticleTranslationTaskshelper.internal/app/tags.go: tags create and tags update built the same six-flag set independently; both now use onenewTagAttributeFlagSethelper.internal/app/person_identities.go: show and archive shared their whole parse-and-run skeleton; both are now thin wrappers overrunPersonIdentityCommand.Testing
I ran the gates locally against the released v0.3.0 binary and the refactored packages' tests.
slophammer check .— OK, scope: 71 of 71 production filesslophammer-go dry ..— 0 candidates (was 3)slophammer-go mutate .. --scan— passesgo build ./...,go vet, andgo testforinternal/appandinternal/translation— tag, person-identity, and translation tests all passRisks
The dedup refactors are behavior-preserving extractions and the affected command tests pass, but they touch three production files, so review attention should go there rather than to the mechanical config migration.
Two
internal/apptests fail on macOS due to/private/varsymlink resolution; they are unrelated path-resolution tests and pass on Linux CI.