Skip to content

Use go mod tidy -diff#30

Merged
swalkinshaw merged 1 commit intoroots:mainfrom
tangrufus:mod-tidy-diff
Mar 19, 2026
Merged

Use go mod tidy -diff#30
swalkinshaw merged 1 commit intoroots:mainfrom
tangrufus:mod-tidy-diff

Conversation

@tangrufus
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 18, 2026 17:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s module-tidiness checks to use go mod tidy -diff, aligning local linting and CI with a non-mutating, diff-based verification approach.

Changes:

  • Replace the Makefile lint target’s go mod tidy + git diff check with go mod tidy -diff.
  • Simplify the CI “Go Modules Tidy” job to run go mod tidy -diff directly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Makefile Uses go mod tidy -diff during make lint instead of modifying files and then checking git diff.
.github/workflows/ci.yml Replaces the inline shell script for tidiness checking with go mod tidy -diff.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@if [ -n "$$(gofmt -s -l .)" ]; then echo "gofmt needed:"; gofmt -s -l .; exit 1; fi
go vet ./...
@go mod tidy && if [ -n "$$(git diff --name-only -- go.mod go.sum)" ]; then echo "go mod tidy needed"; exit 1; fi
go mod tidy -diff
git diff -- go.mod go.sum
exit 1
fi
run: go mod tidy -diff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️ I don't mind either way

@swalkinshaw swalkinshaw merged commit 29fcb13 into roots:main Mar 19, 2026
9 of 10 checks passed
@tangrufus tangrufus deleted the mod-tidy-diff branch March 19, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants