Skip to content

Commit

Permalink
Merge pull request #127 from mmorel-35/linters
Browse files Browse the repository at this point in the history
ci: enable more linters
  • Loading branch information
nscuro committed Nov 5, 2023
2 parents 962ee77 + ffc9a4e commit f173d43
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -35,10 +35,12 @@ jobs:
with:
go-version: "1.20"
check-latest: true
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # tag=v3.7.0
with:
version: latest
args: --verbose

test:
name: Test
Expand Down
12 changes: 11 additions & 1 deletion .golangci.yml
@@ -1,6 +1,16 @@
linters:
enable:
- asciicheck
- gofmt
- errorlint
- gci
- gofumpt
- gosec
- wastedassign

linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/CycloneDX)
custom-order: true
2 changes: 1 addition & 1 deletion cyclonedx_xml.go
Expand Up @@ -52,7 +52,7 @@ func (c *Copyright) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
if err := d.DecodeElement(&text, &start); err != nil {
return err
}
(*c).Text = text
c.Text = text
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions validate_json_test.go
Expand Up @@ -19,6 +19,7 @@ package cyclonedx

import (
"fmt"

"github.com/xeipuuv/gojsonschema"
)

Expand All @@ -29,8 +30,7 @@ var jsonSchemaFiles = map[SpecVersion]string{
SpecVersion1_5: "file://./schema/bom-1.5.schema.json",
}

type jsonValidator struct {
}
type jsonValidator struct{}

func newJSONValidator() validator {
return &jsonValidator{}
Expand Down
6 changes: 3 additions & 3 deletions validate_xml_test.go
Expand Up @@ -19,8 +19,9 @@ package cyclonedx

import (
"fmt"
"github.com/terminalstatic/go-xsd-validate"
"sync"

"github.com/terminalstatic/go-xsd-validate"
)

var xmlSchemaFiles = map[SpecVersion]string{
Expand All @@ -34,8 +35,7 @@ var xmlSchemaFiles = map[SpecVersion]string{

var xsdValidateInitOnce sync.Once

type xmlValidator struct {
}
type xmlValidator struct{}

func newXMLValidator() validator {
var initErr error
Expand Down

0 comments on commit f173d43

Please sign in to comment.