Skip to content

Commit

Permalink
fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancurrah committed Jul 28, 2022
1 parent abc6380 commit dae0793
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 38 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Go
on:
push:
branches:
- master
- main

pull_request:
branches:
- master
- main

permissions:
actions: none
Expand All @@ -26,15 +26,11 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ^1.16
id: go
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build
run: make build
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
tags:
- v*
branches:
- master
- main

pull_request:
branches:
- master
- main

permissions:
actions: none
Expand All @@ -28,8 +28,13 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.39
- uses: actions/setup-go@v3
with:
go-version: 1.17

- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
3 changes: 2 additions & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
env:
Expand Down
18 changes: 0 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ linters-settings:
severity: warning
rules:
- name: atomic
# - name: bare-return
- name: blank-imports
- name: bool-literal-in-expr
- name: call-to-gc
Expand All @@ -28,7 +27,6 @@ linters-settings:
- name: error-strings
- name: errorf
- name: exported
# - name: flag-parameter
- name: get-return
- name: identical-branches
- name: if-return
Expand All @@ -50,11 +48,9 @@ linters-settings:
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
# - name: unhandled-error
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
# - name: unused-receiver
- name: var-declaration
- name: var-naming
- name: waitgroup-by-value
Expand All @@ -64,38 +60,30 @@ linters:
enable:
- asciicheck
- bodyclose
# - cyclop
- deadcode
- dogsled
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
# - exhaustivestruct
- exportloopref
# - forbidigo
- forcetypeassert
- funlen
# - gci
# - gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
# - ifshort
- importas
- ineffassign
- lll
Expand All @@ -104,20 +92,16 @@ linters:
- nakedret
- nestif
- nilerr
# - nlreturn
- noctx
- nolintlint
# - paralleltest
- prealloc
- predeclared
# - promlinter
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
# - tagliatelle
- testpackage
- thelper
- tparallel
Expand All @@ -126,7 +110,5 @@ linters:
- unparam
- unused
- varcheck
# - wastedassign
- whitespace
# - wrapcheck
- wsl
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ clean:
rm -rf dist/
rm -f gomodguard coverage.xml coverage.out

.PHONY: install-tools-mac
.PHONY: install-mac-tools
install-tools-mac:
brew install goreleaser/tap/goreleaser

Expand Down
5 changes: 3 additions & 2 deletions gomodguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ var (
blockReasonHasLocalReplaceDirective = "import of package `%s` is blocked because the module has a " +
"local replace directive."

// startsWithVersion is used to test when a string begins with the version identifier of a module, after having stripped the prefix base module name
// ie "github.com/foo/bar/v2/baz" => "/v2/baz" probably indicates that the module is actually github.com/foo/bar/v2, not github.com/foo/bar
// startsWithVersion is used to test when a string begins with the version identifier of a module,
// after having stripped the prefix base module name. IE "github.com/foo/bar/v2/baz" => "/v2/baz"
// probably indicates that the module is actually github.com/foo/bar/v2, not github.com/foo/bar.
startsWithVersion = regexp.MustCompile(`^\/v[0-9]+`)
)

Expand Down

0 comments on commit dae0793

Please sign in to comment.