Skip to content

Commit

Permalink
ci: update golangci-lint to v1.54 (#661)
Browse files Browse the repository at this point in the history
I'm going to update to v1.55 shortly but this can be landed as-is - I
was initially on the fence about `tagalign` mainly because it has to be
done manually, but it wasn't that much work and I think might actually
be nice so I vote we live with it for a while and revisit if it ends up
being too annoying.
  • Loading branch information
G-Rath authored Nov 21, 2023
1 parent a3bda96 commit 0e0d6fd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ runs:
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.51.1
version: v1.54.2
# https://github.com/golangci/golangci-lint-action/issues/135
skip-pkg-cache: true
skip-pkg-cache: true
60 changes: 30 additions & 30 deletions pkg/models/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
//
// See: https://ossf.github.io/osv-schema/#affectedpackage-field
type Package struct {
Ecosystem Ecosystem `json:"ecosystem" yaml:"ecosystem"`
Name string `json:"name" yaml:"name"`
Ecosystem Ecosystem `json:"ecosystem" yaml:"ecosystem"`
Name string `json:"name" yaml:"name"`
Purl string `json:"purl,omitempty" yaml:"purl,omitempty"`
}

Expand All @@ -27,19 +27,19 @@ type Package struct {
//
// See: https://ossf.github.io/osv-schema/#affectedrangesevents-fields
type Event struct {
Introduced string `json:"introduced,omitempty" yaml:"introduced,omitempty"`
Fixed string `json:"fixed,omitempty" yaml:"fixed,omitempty"`
Introduced string `json:"introduced,omitempty" yaml:"introduced,omitempty"`
Fixed string `json:"fixed,omitempty" yaml:"fixed,omitempty"`
LastAffected string `json:"last_affected,omitempty" yaml:"last_affected,omitempty"`
Limit string `json:"limit,omitempty" yaml:"limit,omitempty"`
Limit string `json:"limit,omitempty" yaml:"limit,omitempty"`
}

// Range describes the affected range of given version for a specific package.
//
// See: https://ossf.github.io/osv-schema/#affectedranges-field
type Range struct {
Type RangeType `json:"type" yaml:"type"`
Events []Event `json:"events" yaml:"events"`
Repo string `json:"repo,omitempty" yaml:"repo,omitempty"`
Type RangeType `json:"type" yaml:"type"`
Events []Event `json:"events" yaml:"events"`
Repo string `json:"repo,omitempty" yaml:"repo,omitempty"`
DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"`
}

Expand All @@ -48,7 +48,7 @@ type Range struct {
//
// See: https://ossf.github.io/osv-schema/#severity-field
type Severity struct {
Type SeverityType `json:"type" yaml:"type"`
Type SeverityType `json:"type" yaml:"type"`
Score string `json:"score" yaml:"score"`
}

Expand All @@ -57,11 +57,11 @@ type Severity struct {
//
// See: https://ossf.github.io/osv-schema/#affected-fields
type Affected struct {
Package Package `json:"package,omitempty" yaml:"package,omitempty"`
Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"`
Ranges []Range `json:"ranges,omitempty" yaml:"ranges,omitempty"`
Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"`
DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"`
Package Package `json:"package,omitempty" yaml:"package,omitempty"`
Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"`
Ranges []Range `json:"ranges,omitempty" yaml:"ranges,omitempty"`
Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"`
DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"`
EcosystemSpecific map[string]interface{} `json:"ecosystem_specific,omitempty" yaml:"ecosystem_specific,omitempty"`
}

Expand Down Expand Up @@ -92,16 +92,16 @@ func (a Affected) MarshalJSON() ([]byte, error) {
// See: https://ossf.github.io/osv-schema/#references-field
type Reference struct {
Type ReferenceType `json:"type" yaml:"type"`
URL string `json:"url" yaml:"url"`
URL string `json:"url" yaml:"url"`
}

// Credit gives credit for the discovery, confirmation, patch, or other events
// in the life cycle of a vulnerability.
//
// See: https://ossf.github.io/osv-schema/#credits-fields
type Credit struct {
Name string `json:"name" yaml:"name"`
Type CreditType `json:"type,omitempty" yaml:"type,omitempty"`
Name string `json:"name" yaml:"name"`
Type CreditType `json:"type,omitempty" yaml:"type,omitempty"`
Contact []string `json:"contact,omitempty" yaml:"contact,omitempty"`
}

Expand All @@ -110,19 +110,19 @@ type Credit struct {
// The full documentation for the schema is available at
// https://ossf.github.io/osv-schema.
type Vulnerability struct {
SchemaVersion string `json:"schema_version,omitempty" yaml:"schema_version,omitempty"`
ID string `json:"id" yaml:"id"`
Modified time.Time `json:"modified" yaml:"modified"`
Published time.Time `json:"published,omitempty" yaml:"published,omitempty"`
Withdrawn time.Time `json:"withdrawn,omitempty" yaml:"withdrawn,omitempty"`
Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"`
Related []string `json:"related,omitempty" yaml:"related,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Details string `json:"details,omitempty" yaml:"details,omitempty"`
Affected []Affected `json:"affected,omitempty" yaml:"affected,omitempty"`
Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"`
References []Reference `json:"references,omitempty" yaml:"references,omitempty"`
Credits []Credit `json:"credits,omitempty" yaml:"credits,omitempty"`
SchemaVersion string `json:"schema_version,omitempty" yaml:"schema_version,omitempty"`
ID string `json:"id" yaml:"id"`
Modified time.Time `json:"modified" yaml:"modified"`
Published time.Time `json:"published,omitempty" yaml:"published,omitempty"`
Withdrawn time.Time `json:"withdrawn,omitempty" yaml:"withdrawn,omitempty"`
Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"`
Related []string `json:"related,omitempty" yaml:"related,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Details string `json:"details,omitempty" yaml:"details,omitempty"`
Affected []Affected `json:"affected,omitempty" yaml:"affected,omitempty"`
Severity []Severity `json:"severity,omitempty" yaml:"severity,omitempty"`
References []Reference `json:"references,omitempty" yaml:"references,omitempty"`
Credits []Credit `json:"credits,omitempty" yaml:"credits,omitempty"`
DatabaseSpecific map[string]interface{} `json:"database_specific,omitempty" yaml:"database_specific,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_lints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -ex

go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.1 run ./... --max-same-issues 0
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 run ./... --max-same-issues 0

0 comments on commit 0e0d6fd

Please sign in to comment.