Skip to content

Commit

Permalink
ci: lefthook
Browse files Browse the repository at this point in the history
  • Loading branch information
ookkoouu committed Mar 18, 2024
1 parent 82a3810 commit cafbd5f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
23 changes: 3 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Go",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
},
"postCreateCommand": "/bin/sh .devcontainer/postCreate.sh"
}
3 changes: 3 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go install github.com/evilmartians/lefthook@latest
go install github.com/spf13/cobra-cli@latest
go install github.com/goreleaser/goreleaser@latest
3 changes: 2 additions & 1 deletion .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Create Release PR
on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -14,4 +15,4 @@ jobs:
- uses: google-github-actions/release-please-action@v4
with:
release-type: go
skip-github-release: true
skip-github-release: true
1 change: 0 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ changelog:
sort: asc
filters:
exclude:
- "^chore:"
- "^test:"
16 changes: 16 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

pre-commit:
parallel: true
commands:
gofmt:
glob: "*.{go}"
run: >
go fmt
&& git update-index --again
govet:
glob: "*.{go}"
run: >
go vet
&& git update-index --again

0 comments on commit cafbd5f

Please sign in to comment.