Skip to content

Commit

Permalink
Fixing linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Jul 17, 2024
1 parent 9d6d5b2 commit efc33d5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 53 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v3

- name: Prepare .netrc
uses: extractions/netrc@v1
with:
machine: github.com
username: ${{ secrets.GO_MOD_USER }}
password: ${{ secrets.GO_MOD_PASS }}

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: "1.20.4"
go-version-file: "go.mod"
id: go

- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v2
with:
version: v1.55
version: v1.58
20 changes: 4 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: "1.21.5"
id: go

- name: Check out code
uses: actions/checkout@v3

#- name: Configure git for private modules
# run: |
# git config --global url."https://${{ secrets.GO_MOD_USER }}:${{ secrets.GO_MOD_PASS }}@github.com".insteadOf "https://github.com"

- name: Prepare .netrc
uses: extractions/netrc@v1
- name: Set up Go
uses: actions/setup-go@v4
with:
machine: github.com
username: ${{ secrets.GO_MOD_USER }}
password: ${{ secrets.GO_MOD_PASS }}
go-version-file: "go.mod"
id: go

- name: Install Dependencies
env:
GOPROXY: https://proxy.golang.org,direct
GOPRIVATE: github.com/invopop
run: go mod download

- name: Test
Expand Down
15 changes: 0 additions & 15 deletions .golangci.toml

This file was deleted.

30 changes: 30 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
run:
timeout: "120s"

output:
formats:
- format: "colored-line-number"

linters:
enable:
- "gocyclo"
- "unconvert"
- "goimports"
- "govet"
#- "misspell" # doesn't handle multilanguage well
- "nakedret"
- "revive"
- "goconst"
- "unparam"
- "gofmt"
- "errname"
- "zerologlint"

linters-settings:
staticcheck:
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all"]

issues:
exclude-use-default: false
10 changes: 0 additions & 10 deletions tax_id.go

This file was deleted.

2 changes: 1 addition & 1 deletion test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func ConvertFromGOBL(env *gobl.Envelope, converter ...*fatturapa.Converter) (*fa
// into XML fatturapa documents.
func TestConversion() error { // nolint:revive
var files []string
err := filepath.Walk(GetDataPath(), func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(GetDataPath(), func(path string, _ os.FileInfo, _ error) error {
if filepath.Ext(path) == ".json" {
files = append(files, filepath.Base(path))
}
Expand Down

0 comments on commit efc33d5

Please sign in to comment.