From 6b7ea5f1d0ab07ab3b4566812dad971fa2395ed4 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Mon, 16 Nov 2026 00:50:42 +0400 Subject: [PATCH 1/5] fix(make): mark the targets phony and let the full lint fail - .PHONY listed the targets with commas, so it declared "vet," and the like: a file named vet made `make vet` a no-op. - Drop VERSION, APP_NAME and BIN_DIR. VERSION referenced $(git ...) as a make variable, which expands to nothing; no script used VERSION, and APP_NAME was only echoed. - .golangci.yml set issues-exit-code: 0, so `make lint-full` passed with any findings. Co-Authored-By: Claude Opus 5.5 --- .golangci.yml | 1 - Makefile | 9 +-------- scripts/release/check.sh | 4 +--- scripts/release/local-snapshot-release.sh | 4 +--- scripts/release/release.sh | 4 ---- 5 files changed, 3 insertions(+), 19 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ae26984c..60d7b8a1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,5 @@ version: "2" run: - issues-exit-code: 0 tests: true output: formats: diff --git a/Makefile b/Makefile index 25ad44fc..812ab757 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,4 @@ -.PHONY: help, test-cover, prepare-cover-report, open-cover-report, update-readme-cover, update-readme-doc, test, test-regression, configure, tidy, imports, fmt, format-project, install-tools, vet, lint-full, lint-pipeline, lint-sonar, release, release-local-snapshot, check-releaser, new-version -BIN_DIR=./bin - -SHELL := env VERSION=$(VERSION) $(SHELL) -VERSION ?= $(shell git describe --tags $(git rev-list --tags --max-count=1)) - -APP_NAME?=getenv -SHELL := env APP_NAME=$(APP_NAME) $(SHELL) +.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test test-regression configure tidy imports fmt format-project install-tools vet lint-full lint-pipeline lint-sonar release release-local-snapshot check-releaser new-version GOVERSION:=1.27.4 diff --git a/scripts/release/check.sh b/scripts/release/check.sh index e770b4f8..a7dccf3c 100755 --- a/scripts/release/check.sh +++ b/scripts/release/check.sh @@ -9,9 +9,7 @@ SCRIPTS_DIR="${REPO_ROOT}/scripts" source "${SCRIPTS_DIR}/helpers-source.sh" -APP=${APP_NAME} - -echo "${SCRIPT_NAME} is running fo ${APP}... " +echo "${SCRIPT_NAME} is running... " check_installed 'goreleaser' diff --git a/scripts/release/local-snapshot-release.sh b/scripts/release/local-snapshot-release.sh index 2f4d39ae..0c6375c3 100755 --- a/scripts/release/local-snapshot-release.sh +++ b/scripts/release/local-snapshot-release.sh @@ -9,9 +9,7 @@ SCRIPTS_DIR="${REPO_ROOT}/scripts" source "${SCRIPTS_DIR}/helpers-source.sh" -APP=${APP_NAME} - -echo "${SCRIPT_NAME} is running fo ${APP}... " +echo "${SCRIPT_NAME} is running... " check_installed 'goreleaser' diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 8721a5a8..f540daa0 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -15,8 +15,4 @@ check_installed 'goreleaser' goreleaser healthcheck -APP=${APP_NAME} - -echo "${SCRIPT_NAME} is running fo ${APP}... " - goreleaser release --clean From 98a61c5fabc26d55e8f826c6780d6aa08c42ded5 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Mon, 16 Nov 2026 00:51:38 +0400 Subject: [PATCH 2/5] ci: lint with one config CI gated on .golangci.pipe.yml with 5 linters, while .golangci.yml with 25 linters only fed Sonar and never failed. The code passes the full config, so gate on it and drop the pipe config. Its errcheck settings and the revive defer rule move into .golangci.yml. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/go.yml | 2 +- .golangci.pipe.yml | 75 ---------------------------- .golangci.yml | 13 +++++ Makefile | 6 +-- scripts/linting/golangci-pipeline.sh | 18 ------- 5 files changed, 15 insertions(+), 99 deletions(-) delete mode 100644 .golangci.pipe.yml delete mode 100755 scripts/linting/golangci-pipeline.sh diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7039faac..00603168 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -120,7 +120,7 @@ jobs: uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: version: ${{ steps.golangci-lint.outputs.version }} - args: --config .golangci.pipe.yml + args: --config .golangci.yml reports: needs: [ testing, linting, build ] diff --git a/.golangci.pipe.yml b/.golangci.pipe.yml deleted file mode 100644 index 43d87a63..00000000 --- a/.golangci.pipe.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: "2" -run: - issues-exit-code: 1 - tests: true -output: - formats: - text: - path: stderr - print-linter-name: true - print-issued-lines: true - checkstyle: - path: linters-report.xml - path-prefix: "" -linters: - default: none - enable: - - errcheck - - govet - - revive - - staticcheck - - unused - settings: - errcheck: - check-type-assertions: true - check-blank: true - revive: - severity: warning - rules: - - name: indent-error-flow - severity: warning - - name: exported - severity: warning - - name: defer - arguments: - - - call-chain - - loop - - method-call - - recover - - return - severity: warning - exclusions: - generated: lax - rules: - - linters: - - dupl - - funlen - - gocyclo - - gosec - path: _test\.go - - path: (.+)\.go$ - text: exported func * returns unexported type *, which can be annoying to use - - path: (.+)\.go$ - text: should have a package comment, unless it's in another file for this package - paths: - - third_party$ - - builtin$ - - examples$ -issues: - uniq-by-line: true -formatters: - enable: - - gofmt - - goimports - settings: - gofmt: - simplify: true - goimports: - local-prefixes: - - github.com/obalunenko/getenv/ - exclusions: - generated: lax - paths: - - third_party$ - - builtin$ - - examples$ diff --git a/.golangci.yml b/.golangci.yml index 60d7b8a1..35f1a9b3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,6 +45,9 @@ linters: settings: dupl: threshold: 100 + errcheck: + check-type-assertions: true + check-blank: true funlen: lines: 100 statements: 50 @@ -127,6 +130,16 @@ linters: require-explanation: false require-specific: false allow-unused: false + revive: + enable-default-rules: true + rules: + - name: defer + arguments: + - - call-chain + - loop + - method-call + - recover + - return wsl_v5: allow-first-in-block: true allow-whole-block: false diff --git a/Makefile b/Makefile index 812ab757..4768150b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test test-regression configure tidy imports fmt format-project install-tools vet lint-full lint-pipeline lint-sonar release release-local-snapshot check-releaser new-version +.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test test-regression configure tidy imports fmt format-project install-tools vet lint-full lint-sonar release release-local-snapshot check-releaser new-version GOVERSION:=1.27.4 @@ -79,10 +79,6 @@ vet: lint-full: ./scripts/linting/run-linters.sh -## Run linting for build pipeline -lint-pipeline: - ./scripts/linting/golangci-pipeline.sh - ## Run linting for sonar report lint-sonar: ./scripts/linting/golangci-sonar.sh diff --git a/scripts/linting/golangci-pipeline.sh b/scripts/linting/golangci-pipeline.sh deleted file mode 100755 index 87659b47..00000000 --- a/scripts/linting/golangci-pipeline.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -SCRIPT_NAME="$(basename "$0")" -SCRIPT_DIR="$(dirname "$0")" -REPO_ROOT="$(cd "${SCRIPT_DIR}" && git rev-parse --show-toplevel)" -SCRIPTS_DIR="${REPO_ROOT}/scripts" - -echo "${SCRIPT_NAME} is running... " - -source "${SCRIPTS_DIR}/linting/linters-source.sh" - -echo "Linting..." - -go_tool golangci-lint run --config .golangci.pipe.yml - -echo "${SCRIPT_NAME} done." From 3b85e037fd7429df7562d4929570861a81570f7e Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Mon, 16 Nov 2026 00:52:15 +0400 Subject: [PATCH 3/5] chore: remove dead scripts and config - go_lint (golint is deprecated) and golangci_ci_execute, which nothing called, and the unused browser-opener.sh. - GO111MODULE=on, the default since Go 1.16. - Lint exclusions for paths the repo does not have (*.pb.go, vendor/, third_party, builtin, examples) and settings of gci, which is off. - The goreleaser checksum section: builds are skipped, so there is nothing to sum. - test-regression, an alias of test, and the call of the undefined colored function in help. Co-Authored-By: Claude Opus 5.5 --- .golangci.yml | 20 ------------------ .goreleaser.yml | 3 --- Makefile | 8 ++----- scripts/browser-opener.sh | 35 ------------------------------- scripts/linting/linters-source.sh | 30 -------------------------- scripts/tests/coverage.sh | 2 -- 6 files changed, 2 insertions(+), 96 deletions(-) delete mode 100755 scripts/browser-opener.sh diff --git a/.golangci.yml b/.golangci.yml index 35f1a9b3..18f4b7d5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -158,12 +158,6 @@ linters: text: exported func * returns unexported type *, which can be annoying to use - path: (.+)\.go$ text: should have a package comment, unless it's in another file for this package - paths: - - \.pb\.go$ - - vendor/ - - third_party$ - - builtin$ - - examples$ issues: uniq-by-line: true new: false @@ -179,22 +173,8 @@ formatters: - gofmt - goimports settings: - gci: - sections: - - standard - - default - - prefix(github.com/obalunenko) - - localmodule - custom-order: true - no-lex-order: true goimports: local-prefixes: - github.com/obalunenko/getenv exclusions: generated: lax - paths: - - \.pb\.go$ - - vendor/ - - third_party$ - - builtin$ - - examples$ diff --git a/.goreleaser.yml b/.goreleaser.yml index 904b5f5c..e616b588 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,9 +10,6 @@ release: builds: - skip: true -checksum: - name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt" - snapshot: version_template: SNAPSHOT-{{ .Commit }} diff --git a/Makefile b/Makefile index 4768150b..d252760e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test test-regression configure tidy imports fmt format-project install-tools vet lint-full lint-sonar release release-local-snapshot check-releaser new-version +.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test configure tidy imports fmt format-project install-tools vet lint-full lint-sonar release release-local-snapshot check-releaser new-version GOVERSION:=1.27.4 @@ -6,7 +6,6 @@ TARGET_MAX_CHAR_NUM=20 ## Show help help: - ${call colored, help is running...} @echo '' @echo 'Usage:' @echo ' make ' @@ -46,9 +45,6 @@ update-readme-doc: test: ./scripts/tests/run.sh -## Run regression tests. -test-regression: test - ## Tidy go.mod and install needed tools. configure: tidy install-tools @@ -96,7 +92,7 @@ check-releaser: ./scripts/release/check.sh ## Issue new release. -new-version: vet test-regression +new-version: vet test ./scripts/release/new-version.sh bump-go-version: diff --git a/scripts/browser-opener.sh b/scripts/browser-opener.sh deleted file mode 100755 index c9f616b7..00000000 --- a/scripts/browser-opener.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -SCRIPT_NAME="$(basename "$0")" -SCRIPT_DIR="$(dirname "$0")" -REPO_ROOT="$(cd "${SCRIPT_DIR}" && git rev-parse --show-toplevel)" -SCRIPTS_DIR="${REPO_ROOT}/scripts" - -source "${SCRIPTS_DIR}/helpers-source.sh" - -echo "${SCRIPT_NAME} is running... " - -URL="" - -while getopts u: flag; do - case "${flag}" in - u) - URL=${OPTARG} - ;; - *) - echo "Unknown flag passed" - exit 1 - ;; - esac -done - -function open_url() { - echo "${URL}" - open_source "${URL}" -} - -open_url - -echo "${SCRIPT_NAME} done." diff --git a/scripts/linting/linters-source.sh b/scripts/linting/linters-source.sh index 6bcb13d9..5636d679 100755 --- a/scripts/linting/linters-source.sh +++ b/scripts/linting/linters-source.sh @@ -43,28 +43,6 @@ function fmt() { echo "" } -function go_lint() { - echo "golint..." - - check_installed 'golint' - - declare -a lints=$(golint $(go list ./...)) ## its a hack to not lint generated code - if [[ ${lints} ]]; then - echo "fix it:" - for l in "${lints[@]}"; do - echo "$l" - - done - exit 1 - - else - echo "code is ok" - echo ${lints} - fi - - echo "" -} - function go_group() { echo "goimports..." @@ -93,11 +71,3 @@ function golangci() { echo "" } - -function golangci_ci_execute() { - echo "golangci-lint-ci_execute linter running..." - - go_tool golangci-lint run ./... >linters.out - - echo "" -} diff --git a/scripts/tests/coverage.sh b/scripts/tests/coverage.sh index 2d4bfefb..81dd8918 100755 --- a/scripts/tests/coverage.sh +++ b/scripts/tests/coverage.sh @@ -12,8 +12,6 @@ source "${SCRIPTS_DIR}/helpers-source.sh" echo "${SCRIPT_NAME} is running... " -export GO111MODULE=on - rm -rf "${COVER_DIR}" mkdir -p "${COVER_DIR}" From 93e5c4074d5f3a994250e3c6ddb8ef26969bd3d7 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Mon, 16 Nov 2026 00:53:17 +0400 Subject: [PATCH 4/5] ci: drop SonarCloud and the coverage badge Codecov already reports coverage on PRs and has a badge, and the lint job gates on golangci-lint, so Sonar duplicated both. The coverbadger badge was a third coverage number, and coverbadger is not even pinned in tools/. This also drops what only Sonar read: the checkstyle report, the go test JSON report and the second lint run in the reports job. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/go.yml | 18 ----------------- .gitignore | 3 --- .golangci.yml | 2 -- Makefile | 10 +--------- README.md | 2 -- scripts/linting/golangci-sonar.sh | 18 ----------------- scripts/tests/coverage.sh | 2 +- scripts/update-readme-coverage.sh | 27 ------------------------- sonar-project.properties | 33 ------------------------------- 9 files changed, 2 insertions(+), 113 deletions(-) delete mode 100755 scripts/linting/golangci-sonar.sh delete mode 100755 scripts/update-readme-coverage.sh delete mode 100644 sonar-project.properties diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 00603168..1612ba64 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -153,19 +153,6 @@ jobs: make prepare-cover-report shell: bash - - name: Get golangci-lint version - id: golangci-lint - run: | - echo "version=$(awk '$1 == "github.com/golangci/golangci-lint/v2" { print $2 }' tools/golangci-lint/go.mod)" >> "$GITHUB_OUTPUT" - shell: bash - - # .golangci.yml writes the checkstyle report for Sonar to linters-report.xml. - - name: Prepare lint report - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - version: ${{ steps.golangci-lint.outputs.version }} - args: --config .golangci.yml - # Codecov rejects tokenless uploads to the default branch; authenticate with OIDC. - name: Cover report upload if: success() @@ -175,8 +162,3 @@ jobs: disable_search: true use_oidc: true fail_ci_if_error: true - - - name: SonarCloud report upload - uses: SonarSource/sonarqube-scan-action@59202af334b4ba7b5db01b701b8e79f8b3bef0f4 # v8.5.0 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.gitignore b/.gitignore index 358eafd2..dd2247dd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,12 +19,9 @@ bin/ dist/ coverage/ .DS_Store -tests-report.json README_doc.md .vscode/ -linters-report.xml - # Codecov CLI downloaded by codecov-action in CI /codecov /codecov.SHA256SUM diff --git a/.golangci.yml b/.golangci.yml index 18f4b7d5..8990dcfc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,8 +7,6 @@ output: path: stderr print-linter-name: true print-issued-lines: true - checkstyle: - path: linters-report.xml sort-order: - linter - severity diff --git a/Makefile b/Makefile index d252760e..b29c9d62 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-cover update-readme-doc test configure tidy imports fmt format-project install-tools vet lint-full lint-sonar release release-local-snapshot check-releaser new-version +.PHONY: help test-cover prepare-cover-report open-cover-report update-readme-doc test configure tidy imports fmt format-project install-tools vet lint-full release release-local-snapshot check-releaser new-version GOVERSION:=1.27.4 @@ -33,10 +33,6 @@ prepare-cover-report: test-cover open-cover-report: prepare-cover-report ./scripts/open-coverage-report.sh -## Update readme coverage. -update-readme-cover: prepare-cover-report - ./scripts/update-readme-coverage.sh - ## Update readme doc. update-readme-doc: ./scripts/update-readme-doc.sh @@ -75,10 +71,6 @@ vet: lint-full: ./scripts/linting/run-linters.sh -## Run linting for sonar report -lint-sonar: - ./scripts/linting/golangci-sonar.sh - ## Release release: ./scripts/release/release.sh diff --git a/README.md b/README.md index 7597a7a6..b6fd537d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/obalunenko/getenv.svg)](https://pkg.go.dev/github.com/obalunenko/getenv) [![Go Report Card](https://goreportcard.com/badge/github.com/obalunenko/getenv)](https://goreportcard.com/report/github.com/obalunenko/getenv) [![codecov](https://codecov.io/gh/obalunenko/getenv/branch/master/graph/badge.svg)](https://codecov.io/gh/obalunenko/getenv) -![coverbadger-tag-do-not-edit](https://img.shields.io/badge/coverage-88.38%25-brightgreen?longCache=true&style=flat) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=obalunenko_getenv&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=obalunenko_getenv) # getenv diff --git a/scripts/linting/golangci-sonar.sh b/scripts/linting/golangci-sonar.sh deleted file mode 100755 index 4ef2221b..00000000 --- a/scripts/linting/golangci-sonar.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -SCRIPT_NAME="$(basename "$0")" -SCRIPT_DIR="$(dirname "$0")" -REPO_ROOT="$(cd "${SCRIPT_DIR}" && git rev-parse --show-toplevel)" -SCRIPTS_DIR="${REPO_ROOT}/scripts" - -echo "${SCRIPT_NAME} is running... " - -source "${SCRIPTS_DIR}/linting/linters-source.sh" - -echo "Linting..." - -go_tool golangci-lint run --config .golangci.yml - -echo "${SCRIPT_NAME} done." diff --git a/scripts/tests/coverage.sh b/scripts/tests/coverage.sh index 81dd8918..ea0f6441 100755 --- a/scripts/tests/coverage.sh +++ b/scripts/tests/coverage.sh @@ -15,6 +15,6 @@ echo "${SCRIPT_NAME} is running... " rm -rf "${COVER_DIR}" mkdir -p "${COVER_DIR}" -go test --count=1 -coverprofile "${COVER_DIR}/unit.cov" -covermode=atomic -json ./... >tests-report.json +go test --count=1 -coverprofile "${COVER_DIR}/unit.cov" -covermode=atomic ./... echo "${SCRIPT_NAME} is done... " diff --git a/scripts/update-readme-coverage.sh b/scripts/update-readme-coverage.sh deleted file mode 100755 index a275328e..00000000 --- a/scripts/update-readme-coverage.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -SCRIPT_NAME="$(basename "$0")" -SCRIPT_DIR="$(dirname "$0")" -REPO_ROOT="$(cd "${SCRIPT_DIR}" && git rev-parse --show-toplevel)" -SCRIPTS_DIR="${REPO_ROOT}/scripts" -COVER_DIR=${REPO_ROOT}/coverage - -source "${SCRIPTS_DIR}/helpers-source.sh" - -echo "${SCRIPT_NAME} is running... " - -check_installed 'coverbadger' - -COVERAGE=$(go_tool gocov report "${COVER_DIR}/full.json" | tail -1 | awk '{if ($1 != "?") print $3; else print "0.0";}' | sed 's/\%//g') -if [[ ${COVERAGE} == "NaN" ]]; then - COVERAGE="0.0" -fi - -coverbadger \ - --coverage="${COVERAGE}" \ - --md="${REPO_ROOT}/README.md" \ - --style=flat - -echo "${SCRIPT_NAME} done." diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index ee9ce2a2..00000000 --- a/sonar-project.properties +++ /dev/null @@ -1,33 +0,0 @@ -# ===================================================== -# Standard properties -# ===================================================== - -sonar.projectKey=obalunenko_getenv -sonar.projectName=getenv -sonar.organization=obalunenko -sonar.projectVersion=1.0 - -sonar.host.url=https://sonarcloud.io -# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -# This property is optional if sonar.modules is set. -sonar.sources=. -sonar.exclusions=**/*_test.go,**/vendor/** - -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.test.exclusions=**/vendor/** -# ===================================================== -# Meta-data for the project -# ===================================================== - -sonar.links.homepage=https://github.com/obalunenko/getenv -sonar.links.ci=https://github.com/obalunenko/getenv/actions -sonar.links.issue=https://github.com/obalunenko/getenv/issues - -# ===================================================== -# Properties specific to Go -# ===================================================== - -sonar.go.golangci-lint.reportPaths=linters-report.xml -sonar.go.tests.reportPaths=tests-report.json -sonar.go.coverage.reportPaths=coverage/full.cov \ No newline at end of file From cf718722b4d5a8629181130ddc8715189b32ede3 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Mon, 16 Nov 2026 00:54:07 +0400 Subject: [PATCH 5/5] chore: drop gotestsum and gocov tools The go command covers what they did: go test runs the tests and go tool cover renders the HTML report. The tool modules needed a newer Go than the oldstable the library supports, which is why CI could not run make test; now it does. Dependabot no longer bumps them. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 3 --- .github/workflows/go.yml | 11 +++----- scripts/tests/coverage.sh | 2 +- scripts/tests/prepare-cover-report.sh | 9 +------ scripts/tests/run.sh | 2 +- tools/gocov-html/go.mod | 11 -------- tools/gocov-html/go.sum | 19 -------------- tools/gocov/go.mod | 12 --------- tools/gocov/go.sum | 18 ------------- tools/gotestsum/go.mod | 22 ---------------- tools/gotestsum/go.sum | 37 --------------------------- 11 files changed, 6 insertions(+), 140 deletions(-) delete mode 100644 tools/gocov-html/go.mod delete mode 100644 tools/gocov-html/go.sum delete mode 100644 tools/gocov/go.mod delete mode 100644 tools/gocov/go.sum delete mode 100644 tools/gotestsum/go.mod delete mode 100644 tools/gotestsum/go.sum diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8c2d8b6b..9db268e8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -36,11 +36,8 @@ updates: # go.mod marks tool modules as indirect, so list them by name: this bumps # the tools and leaves their own dependencies alone. allow: - - dependency-name: "github.com/axw/gocov" - dependency-name: "github.com/golangci/golangci-lint/v2" - - dependency-name: "github.com/matm/gocov-html" - dependency-name: "golang.org/x/tools" - - dependency-name: "gotest.tools/gotestsum" groups: tools: patterns: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1612ba64..bacca0ba 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -80,10 +80,9 @@ jobs: go version shell: bash - # Not make test: it builds gotestsum from tools/, which needs a newer Go than oldstable. - name: Test run: | - go test -race ./... + make test shell: bash linting: @@ -135,22 +134,18 @@ jobs: with: fetch-depth: 0 - # This job builds the coverage tools, so their go.sum files are part of the cache key. - name: Set up go uses: actions/setup-go@v7.0.0 with: go-version: stable - cache-dependency-path: | - go.sum - tools/*/go.sum - run: | go version shell: bash - - name: Prepare test coverage and reports + - name: Test coverage run: | - make prepare-cover-report + make test-cover shell: bash # Codecov rejects tokenless uploads to the default branch; authenticate with OIDC. diff --git a/scripts/tests/coverage.sh b/scripts/tests/coverage.sh index ea0f6441..a52a5953 100755 --- a/scripts/tests/coverage.sh +++ b/scripts/tests/coverage.sh @@ -15,6 +15,6 @@ echo "${SCRIPT_NAME} is running... " rm -rf "${COVER_DIR}" mkdir -p "${COVER_DIR}" -go test --count=1 -coverprofile "${COVER_DIR}/unit.cov" -covermode=atomic ./... +go test --count=1 -coverprofile "${COVER_DIR}/full.cov" -covermode=atomic ./... echo "${SCRIPT_NAME} is done... " diff --git a/scripts/tests/prepare-cover-report.sh b/scripts/tests/prepare-cover-report.sh index df763a43..1755252d 100755 --- a/scripts/tests/prepare-cover-report.sh +++ b/scripts/tests/prepare-cover-report.sh @@ -12,13 +12,6 @@ source "${SCRIPTS_DIR}/helpers-source.sh" echo "${SCRIPT_NAME} is running... " -{ - echo "mode: atomic" - tail -q -n +2 "${COVER_DIR}"/*.cov -} >>"${COVER_DIR}/full.cov" - -go_tool gocov convert "${COVER_DIR}/full.cov" >"${COVER_DIR}/full.json" - -go_tool gocov-html "${COVER_DIR}/full.json" >"${COVER_DIR}/full.html" +go tool cover -html="${COVER_DIR}/full.cov" -o "${COVER_DIR}/full.html" echo "${SCRIPT_NAME} is done... " diff --git a/scripts/tests/run.sh b/scripts/tests/run.sh index e75b0855..67908da9 100755 --- a/scripts/tests/run.sh +++ b/scripts/tests/run.sh @@ -11,6 +11,6 @@ source "${SCRIPTS_DIR}/helpers-source.sh" echo "${SCRIPT_NAME} is running... " -go_tool gotestsum --format testname -- -race ./... +go test -race ./... echo "${SCRIPT_NAME} done." diff --git a/tools/gocov-html/go.mod b/tools/gocov-html/go.mod deleted file mode 100644 index cc9567b4..00000000 --- a/tools/gocov-html/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/obalunenko/getenv/tools/gocov-html - -go 1.27.4 - -tool github.com/matm/gocov-html/cmd/gocov-html - -require ( - github.com/axw/gocov v1.2.1 // indirect - github.com/matm/gocov-html v1.4.0 // indirect - github.com/rotisserie/eris v0.5.4 // indirect -) diff --git a/tools/gocov-html/go.sum b/tools/gocov-html/go.sum deleted file mode 100644 index 6429f2ca..00000000 --- a/tools/gocov-html/go.sum +++ /dev/null @@ -1,19 +0,0 @@ -github.com/axw/gocov v1.1.0/go.mod h1:H9G4tivgdN3pYSSVrTFBr6kGDCmAkgbJhtxFzAvgcdw= -github.com/axw/gocov v1.2.1 h1:bqtQDBC2tQWcPzTYIVxK0EDCfNRLwsk4NZ0+GB4hX8Q= -github.com/axw/gocov v1.2.1/go.mod h1:l11/vZBBKfQEE+42jF47myjDrRZHM+hR+XgGjI6FopU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/matm/gocov-html v1.4.0 h1:fFDUXL6Sagf9vijTAiHqZRhjwrAm5ULbmBAvQ9tBoas= -github.com/matm/gocov-html v1.4.0/go.mod h1:YtmZATysV+F1Q0CyvMjDgVVHHUaXAUbCpvS9onziLK8= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= -github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/gocov/go.mod b/tools/gocov/go.mod deleted file mode 100644 index 7eb83db3..00000000 --- a/tools/gocov/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/obalunenko/getenv/tools/gocov - -go 1.27.4 - -tool github.com/axw/gocov/gocov - -require ( - github.com/axw/gocov v1.2.1 // indirect - golang.org/x/mod v0.42.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/tools v0.52.0 // indirect -) diff --git a/tools/gocov/go.sum b/tools/gocov/go.sum deleted file mode 100644 index fb335925..00000000 --- a/tools/gocov/go.sum +++ /dev/null @@ -1,18 +0,0 @@ -github.com/axw/gocov v1.2.1 h1:bqtQDBC2tQWcPzTYIVxK0EDCfNRLwsk4NZ0+GB4hX8Q= -github.com/axw/gocov v1.2.1/go.mod h1:l11/vZBBKfQEE+42jF47myjDrRZHM+hR+XgGjI6FopU= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/gotestsum/go.mod b/tools/gotestsum/go.mod deleted file mode 100644 index a4780ecb..00000000 --- a/tools/gotestsum/go.mod +++ /dev/null @@ -1,22 +0,0 @@ -module github.com/obalunenko/getenv/tools/gotestsum - -go 1.27.4 - -tool gotest.tools/gotestsum - -require ( - github.com/bitfield/gotestdox v0.2.2 // indirect - github.com/dnephin/pflag v1.0.7 // indirect - github.com/fatih/color v1.18.0 // indirect - github.com/fsnotify/fsnotify v1.9.0 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - golang.org/x/mod v0.42.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/sys v0.49.0 // indirect - golang.org/x/term v0.35.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/tools v0.52.0 // indirect - gotest.tools/gotestsum v1.13.0 // indirect -) diff --git a/tools/gotestsum/go.sum b/tools/gotestsum/go.sum deleted file mode 100644 index 1426f4d3..00000000 --- a/tools/gotestsum/go.sum +++ /dev/null @@ -1,37 +0,0 @@ -github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= -github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= -github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= -github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= -github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= -golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= -gotest.tools/gotestsum v1.13.0 h1:+Lh454O9mu9AMG1APV4o0y7oDYKyik/3kBOiCqiEpRo= -gotest.tools/gotestsum v1.13.0/go.mod h1:7f0NS5hFb0dWr4NtcsAsF0y1kzjEFfAil0HiBQJE03Q= -gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= -gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=