Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
31 changes: 4 additions & 27 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -120,7 +119,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 ]
Expand All @@ -135,37 +134,20 @@ 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
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"
make test-cover
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()
Expand All @@ -175,8 +157,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 }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
75 changes: 0 additions & 75 deletions .golangci.pipe.yml

This file was deleted.

36 changes: 13 additions & 23 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
version: "2"
run:
issues-exit-code: 0
tests: true
output:
formats:
text:
path: stderr
print-linter-name: true
print-issued-lines: true
checkstyle:
path: linters-report.xml
sort-order:
- linter
- severity
Expand Down Expand Up @@ -46,6 +43,9 @@ linters:
settings:
dupl:
threshold: 100
errcheck:
check-type-assertions: true
check-blank: true
funlen:
lines: 100
statements: 50
Expand Down Expand Up @@ -128,6 +128,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
Expand All @@ -146,12 +156,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
Expand All @@ -167,22 +171,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$
3 changes: 0 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ release:
builds:
- skip: true

checksum:
name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt"

snapshot:
version_template: SNAPSHOT-{{ .Commit }}

Expand Down
27 changes: 2 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
.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-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

TARGET_MAX_CHAR_NUM=20

## Show help
help:
${call colored, help is running...}
@echo ''
@echo 'Usage:'
@echo ' make <target>'
Expand Down Expand Up @@ -41,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
Expand All @@ -53,9 +41,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

Expand Down Expand Up @@ -86,14 +71,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

## Release
release:
./scripts/release/release.sh
Expand All @@ -107,7 +84,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:
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
35 changes: 0 additions & 35 deletions scripts/browser-opener.sh

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/linting/golangci-pipeline.sh

This file was deleted.

Loading