Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit] Add go fmt, go mod tidy & bump versions #9870

Merged
merged 1 commit into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
#- id: check-yaml
# args: [--allow-multiple-documents]
Expand Down Expand Up @@ -31,8 +31,14 @@ repos:
exclude: .*/gradlew$

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.5.1"
rev: "v2.6.2"
hooks:
- id: prettier
# Only enabled for WebApp components initially, to build consensus and incrementally onboard others
files: ^components\/(server|gitpod-protocol|gitpod-db|dashboard|ws-manager-bridge)\/.*\.ts(x?)$

- repo: https://github.com/dnephin/pre-commit-golang
rev: "v0.5.0"
hooks:
- id: go-fmt
- id: go-mod-tidy
Comment on lines +43 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems uncontroversial to me, but this will affect all Go components owned by all teams right? So maybe ask for a wider review?

Copy link
Member Author

Choose a reason for hiding this comment

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

We already validate go mod on CI when we run go mod verify, when verify fails, the fix is to run go mod tidy which this check performs. This change mostly shifts 1 CI run cycle into the workspace so it consumes less CI time (and less time for the engineer).