From 24cac547638df5d97b6e687d482c114c9a15044b Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:12:00 +0545 Subject: [PATCH 1/7] Update: Bump `black` revision used for pre-commit Signed-off-by: notsatan --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0829061..172a51a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,6 @@ repos: - id: git-check # check for git conflict markers and whitespace errors - uses git internally - repo: https://github.com/psf/black - rev: 21.9b0 + rev: ec91a2b hooks: - id: black From 9e523c400410cbf4ea1fcc1bcb8dceadf4193a35 Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:13:58 +0545 Subject: [PATCH 2/7] Minor: Trim trailing whitespaces Signed-off-by: notsatan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e5bfaf..dcb20ef 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
![A gif displaying `go-template` in action][demo-gif] - + [![Build status](https://img.shields.io/github/workflow/status/notsatan/go-template/Black?style=for-the-badge&logo=github)][black-action] [![No Dependencies](https://img.shields.io/badge/Dependencies-None-green?style=for-the-badge&logo=dependabot)][gomod-file] [![MIT License](https://img.shields.io/github/license/notsatan/go-template?color=red&style=for-the-badge)][project-license] From 8b57b5d0cb12a1379fb108b7325ca62f91752c66 Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:15:46 +0545 Subject: [PATCH 3/7] Update: Bump Go version choices for generated templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit bumps the Go version(s) offered as a choice, the newer versions include — 1.21, 1.20 and 1.19 Signed-off-by: notsatan --- cookiecutter.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 844023c..4e4a6c2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -9,9 +9,9 @@ "use_codecov": "y", "use_precommit": "y", "go_version": [ - "1.17", - "1.16", - "1.18" + "1.21", + "1.20", + "1.19" ], "license": [ "MIT", From 19d00ed6c5d4a60937f4db4428cdf4d79db4028e Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:23:15 +0545 Subject: [PATCH 4/7] Update: Changes to the `linter` workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `golangci-lint` Github action had some changes since the last version — including the fact that the action stopped setting up Go on the workflow environment This commit primarily adds a new step to setup Go on the runner Signed-off-by: notsatan --- .../.github/workflows/linting.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/{{ cookiecutter.project_name.strip() }}/.github/workflows/linting.yml b/{{ cookiecutter.project_name.strip() }}/.github/workflows/linting.yml index fb21cd9..5401f1e 100644 --- a/{{ cookiecutter.project_name.strip() }}/.github/workflows/linting.yml +++ b/{{ cookiecutter.project_name.strip() }}/.github/workflows/linting.yml @@ -26,6 +26,11 @@ jobs: os: [ ubuntu-latest ] {% raw %} runs-on: ${{ matrix.os }} + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} {% endraw %} steps: - name: Checkout code @@ -35,13 +40,10 @@ jobs: uses: golangci/golangci-lint-action@v3 with: # Must be specified without patch version: we always use the latest patch version. - version: v1.45 - - # If set to true then the action will use pre-installed Go - skip-go-installation: false + version: v1.55 # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 + args: "--timeout 3m" # --issues-exit-code=0 # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true From 254153cecf388596d9f59a76aeab92d3a5d666e6 Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:29:37 +0545 Subject: [PATCH 5/7] Minor: Changes to dockerfile for generated templates Signed-off-by: notsatan --- {{ cookiecutter.project_name.strip() }}/docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.project_name.strip() }}/docker/Dockerfile b/{{ cookiecutter.project_name.strip() }}/docker/Dockerfile index 0bf06e1..cdbb164 100644 --- a/{{ cookiecutter.project_name.strip() }}/docker/Dockerfile +++ b/{{ cookiecutter.project_name.strip() }}/docker/Dockerfile @@ -55,6 +55,5 @@ ENV __BUILD_MODE__=${build_mode} ENV ${build_mode}_mode=${build_mode} # ^^ will be `debug_mode` or `production_mode` - # Run the binary CMD ["./{{ cookiecutter.project_name.strip() }}"] From 3fdc5886bad02ac8e4c67de785aeead7e54a03a0 Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:32:27 +0545 Subject: [PATCH 6/7] Minor: Update ignore rules for `.gitignore` This update ensures generated projects will ignore secret files and the likes from git, by default Signed-off-by: notsatan --- {{ cookiecutter.project_name.strip() }}/.gitignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.project_name.strip() }}/.gitignore b/{{ cookiecutter.project_name.strip() }}/.gitignore index 303c449..f5a8884 100644 --- a/{{ cookiecutter.project_name.strip() }}/.gitignore +++ b/{{ cookiecutter.project_name.strip() }}/.gitignore @@ -1,4 +1,4 @@ -# Cache folder generated by IDE +# Cache folders generated by IDE .vscode/** .idea/** @@ -15,3 +15,9 @@ coverage/** # Ignore config files from project root, keeping sample config files /configs** !/configs.**.sample + +# Ignore all secret files — they'll be used for project sensitive data +**.secrets +**.session +**.secret +**.cookie From 2233531e1fe5f2603cb4a74246d6cbe6c9f5dc60 Mon Sep 17 00:00:00 2001 From: notsatan Date: Tue, 2 Jan 2024 06:52:01 +0545 Subject: [PATCH 7/7] Minor: Changes to generated README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generated README mentioned `Bandit` instead of `GoSec` on the badge label — something that got carried over from Python Signed-off-by: notsatan --- {{ cookiecutter.project_name.strip() }}/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.project_name.strip() }}/README.md b/{{ cookiecutter.project_name.strip() }}/README.md index 4535bde..b645271 100644 --- a/{{ cookiecutter.project_name.strip() }}/README.md +++ b/{{ cookiecutter.project_name.strip() }}/README.md @@ -7,7 +7,7 @@ {% if cookiecutter.use_codecov.lower() == 'y' -%} [![Code Coverage](https://img.shields.io/codecov/c/{{ cookiecutter.go_module_path.strip('/').replace('.com', '') }}?color=blue&logo=codecov&style=for-the-badge)][github-actions-tests] {% endif -%} -[![Security: bandit](https://img.shields.io/badge/Security-GoSec-lightgrey?style=for-the-badge&logo=springsecurity)](https://github.com/securego/gosec) +[![Security: GoSec](https://img.shields.io/badge/Security-GoSec-lightgrey?style=for-the-badge&logo=springsecurity)](https://github.com/securego/gosec) [![Dependencies Status](https://img.shields.io/badge/Dependencies-Up%20to%20Date-brightgreen?style=for-the-badge&logo=dependabot)][dependabot-pulls] [![Semantic Versioning](https://img.shields.io/badge/versioning-semantic-black?style=for-the-badge&logo=semver)][github-releases] [![Pre-Commit Enabled](https://img.shields.io/badge/Pre--Commit-Enabled-blue?style=for-the-badge&logo=pre-commit)][precommit-config]