From 5019a2798d61e27456ad4ab4e46edfe50d7038b2 Mon Sep 17 00:00:00 2001 From: Richard Wooding Date: Tue, 7 Jan 2025 12:46:45 +0000 Subject: [PATCH 1/2] Upgrade devcontianer to go 1.23 --- .devcontainer/devcontainer.json | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6e63be3..04cff14 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "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", + "image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/go.mod b/go.mod index 6f17094..3d3effa 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/spandigital/with -go 1.22.2 +go 1.23.4 From 1f0f825fe75cb90603610be491504bded0499ca2 Mon Sep 17 00:00:00 2001 From: Richard Wooding Date: Tue, 7 Jan 2025 12:54:58 +0000 Subject: [PATCH 2/2] Upgraded devcontainer to use Go 1.23 and added pre-commit configuration. --- .devcontainer/devcontainer.json | 14 ++++++++++---- .pre-commit-config.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 04cff14..183c6b3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8141373 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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']