Skip to content

Commit

Permalink
Upgraded devcontainer to use Go 1.23 and added pre-commit configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwooding committed Jan 7, 2025
1 parent 5019a27 commit 1f0f825
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm",

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

"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/guiyomh/features/golangci-lint:0": {},
"ghcr.io/guiyomh/features/goreleaser:0": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {}
},
// 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",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": ".devcontainer/post-create.sh",

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

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.0
hooks:
- id: go-fmt
- id: go-imports
- id: golangci-lint
- id: go-unit-tests
- id: go-mod-tidy
- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
hooks:
- id: actionlint
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']

0 comments on commit 1f0f825

Please sign in to comment.