-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: go1.18 & improved error messages (#69)
* feat: improve logs of cmd outputs Signed-off-by: Utku Ozdemir <[email protected]> * refactor: workflows Signed-off-by: Utku Ozdemir <[email protected]> * refactor: enable linters Signed-off-by: Utku Ozdemir <[email protected]> * ci: remove gofumpt since it is checked via golangci-lint & remove deprecated config on golangci-lint action Signed-off-by: Utku Ozdemir <[email protected]>
- Loading branch information
1 parent
5b48550
commit f04728f
Showing
14 changed files
with
333 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
|
@@ -22,21 +23,13 @@ on: | |
- "grafana/**" | ||
- "systemd/**" | ||
- "renovate.json" | ||
|
||
concurrency: | ||
group: build-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre_job: | ||
continue-on-error: true | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/[email protected] | ||
with: | ||
cancel_others: true | ||
concurrent_skipping: same_content | ||
build: | ||
needs: pre_job | ||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
|
@@ -45,19 +38,14 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
# renovate: go | ||
go-version: 1.17.5 | ||
go-version: 1.18 | ||
- name: Ensure go.mod is already tidied | ||
run: go mod tidy && git diff --no-patch --exit-code | ||
- name: Install gofumpt | ||
run: go install mvdan.cc/[email protected] | ||
- name: Ensure code is properly formatted using gofumpt | ||
run: test -z "$(gofumpt -d .)" | ||
- name: Run linters | ||
uses: golangci/[email protected] | ||
with: | ||
# renovate: golangci-lint | ||
version: v1.45.2 | ||
skip-go-installation: true | ||
args: --timeout=3m0s | ||
- name: Install go-acc | ||
# renovate: go-acc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: release | |
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
- "v*.*.*" | ||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
|
@@ -18,7 +18,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
# renovate: go | ||
go-version: 1.17.5 | ||
go-version: 1.18 | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# https://golangci-lint.run/usage/linters/ | ||
linters: | ||
enable: | ||
- asciicheck | ||
- bidichk | ||
- containedctx | ||
- contextcheck | ||
- cyclop | ||
- decorder | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forbidigo | ||
- forcetypeassert | ||
- funlen | ||
- gci | ||
# - gochecknoglobals | ||
- gochecknoinits | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- godox | ||
- goerr113 | ||
- gofumpt | ||
- goheader | ||
# - goimports # inconsistent with gci | ||
- gomnd | ||
- gomoddirectives | ||
# - gomodguard # no need | ||
- goprintffuncname | ||
- gosec | ||
- grouper | ||
- ifshort | ||
- importas | ||
- ireturn | ||
- lll | ||
- maintidx | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- nlreturn | ||
- noctx | ||
- nolintlint | ||
- paralleltest | ||
- prealloc | ||
- predeclared | ||
- revive | ||
- rowserrcheck | ||
# - sqlclosecheck | ||
- stylecheck | ||
- tagliatelle | ||
- tenv | ||
# - testpackage # TODO: visit | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- unparam | ||
- varnamelen | ||
- wastedassign | ||
- whitespace | ||
- wrapcheck | ||
- wsl | ||
|
||
linters-settings: | ||
goconst: | ||
ignore-tests: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.