Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .chglog/CHANGELOG.tpl.md

This file was deleted.

28 changes: 0 additions & 28 deletions .chglog/config.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/release.yml

This file was deleted.

164 changes: 96 additions & 68 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,27 @@ linters-settings:

# https://github.com/ultraware/funlen
funlen:
lines: 100
statements: 50
# accounting for comments
lines: 160
statements: 70

# https://github.com/tommy-muehle/go-mnd
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return

# https://github.com/walle/lll
lll:
line-length: 100
# https://github.com/denis-tingaikin/go-header
goheader:
template: |-
Copyright (c) {{ YEAR }} Target Brands, Inc. All rights reserved.

Use of this source code is governed by the LICENSE file in this repository.

# https://github.com/client9/misspell
misspell:
locale: US

# https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint
nolintlint:
allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space)
allow-unused: false # allow nolint directives that don't address a linting issue
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space)
allow-unused: false # allow nolint directives that don't address a linting issue
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped

# This section provides the configuration for which linters
# golangci will execute. Several of them were disabled by
Expand All @@ -62,57 +59,91 @@ linters:

# enable a specific set of linters to run
enable:
- bodyclose
- deadcode # enabled by default
- dupl
- errcheck # enabled by default
- funlen
- goconst
- gocyclo
- godot
- gofmt
- goimports
- revive
- gomnd
- goprintffuncname
- gosec
- gosimple # enabled by default
- govet # enabled by default
- ineffassign # enabled by default
- lll
- misspell
- nakedret
- nolintlint
- staticcheck # enabled by default
- structcheck # enabled by default
- stylecheck
- typecheck # enabled by default
- unconvert
- unparam
- unused # enabled by default
- varcheck # enabled by default
- whitespace

- bidichk # checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- contextcheck # check the function whether use a non-inherited context
- deadcode # finds unused code
- dupl # code clone detection
- errcheck # checks for unchecked errors
- errorlint # find misuses of errors
- exportloopref # check for exported loop vars
- funlen # detects long functions
- goconst # finds repeated strings that could be replaced by a constant
- gocyclo # computes and checks the cyclomatic complexity of functions
- godot # checks if comments end in a period
- gofmt # checks whether code was gofmt-ed
- goheader # checks is file header matches to pattern
- goimports # fixes imports and formats code in same style as gofmt
- gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod
- goprintffuncname # checks that printf-like functions are named with f at the end
- gosec # inspects code for security problems
- gosimple # linter that specializes in simplifying a code
- govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string
- ineffassign # detects when assignments to existing variables aren't used
- makezero # finds slice declarations with non-zero initial length
- misspell # finds commonly misspelled English words in comments
- nakedret # finds naked returns in functions greater than a specified function length
- nilerr # finds the code that returns nil even if it checks that the error is not nil
- noctx # noctx finds sending http request without context.Context
- nolintlint # reports ill-formed or insufficient nolint directives
- revive # linter for go
- staticcheck # applies static analysis checks, go vet on steroids
- structcheck # finds unused struct fields
- stylecheck # replacement for golint
- tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
- typecheck # parses and type-checks go code, like the front-end of a go compiler
- unconvert # remove unnecessary type conversions
- unparam # reports unused function parameters
- unused # checks for unused constants, variables, functions and types
- varcheck # finds unused global variables and constants
- whitespace # detects leading and trailing whitespace
- wsl # forces code to use empty lines

# static list of linters we know golangci can run but we've
# chosen to leave disabled for now
# - asciicheck
# - depguard
# - dogsled
# - exhaustive
# - gochecknoinits
# - gochecknoglobals
# - gocognit
# - gocritic
# - godox
# - goerr113
# - interfacer
# - nestif
# - noctx
# - prealloc
# - rowserrcheck
# - scopelint
# - testpackage
# - wsl
# - asciicheck - non-critical
# - cyclop - unused complexity metric
# - depguard - unused
# - dogsled - blanks allowed
# - durationcheck - unused
# - errname - unused
# - exhaustive - unused
# - exhaustivestruct - style preference
# - forbidigo - unused
# - forcetypeassert - unused
# - gci - use goimports
# - gochecknoinits - unused
# - gochecknoglobals - global variables allowed
# - gocognit - unused complexity metric
# - gocritic - style preference
# - godox - to be used in the future
# - goerr113 - to be used in the future
# - golint - archived, replaced with revive
# - gofumpt - use gofmt
# - gomnd - get too many false-positives
# - gomodguard - unused
# - ifshort - use both styles
# - ireturn - allow interfaces to be returned
# - importas - want flexibility with naming
# - lll - not too concerned about line length
# - interfacer - archived
# - nestif - non-critical
# - nilnil - style preference
# - nlreturn - style preference
# - maligned - archived, replaced with govet 'fieldalignment'
# - paralleltest - false-positives
# - prealloc - don't use
# - predeclared - unused
# - promlinter - style preference
# - rowserrcheck - unused
# - scopelint - deprecated - replaced with exportloopref
# - sqlclosecheck - unused
# - tagliatelle - use a mix of variable naming
# - testpackage - don't use this style of testing
# - thelper - false-positives
# - varnamelen - unused
# - wastedassign - duplicate functionality
# - wrapcheck - style preference

# This section provides the configuration for how golangci
# will report the issues it finds.
Expand All @@ -126,6 +157,3 @@ issues:
- funlen
- goconst
- gocyclo
- gomnd
- lll
- revive
1 change: 0 additions & 1 deletion api/admin/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func AllBuildsQueue(c *gin.Context) {
logrus.Info("Admin: reading running and pending builds")

// default timestamp to 24 hours ago if user did not provide it as query parameter
// nolint: gomnd // ignore magic number
after := c.DefaultQuery("after", strconv.FormatInt(time.Now().UTC().Add(-24*time.Hour).Unix(), 10))

// send API call to capture pending and running builds
Expand Down
2 changes: 0 additions & 2 deletions api/admin/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
// AllDeployments represents the API handler to
// captures all deployments stored in the database.
func AllDeployments(c *gin.Context) {
// nolint: lll // ignore long line length due to return message
c.JSON(http.StatusNotImplemented, "The server does not support the functionality required to fulfill the request.")
}

Expand All @@ -48,6 +47,5 @@ func AllDeployments(c *gin.Context) {
// UpdateDeployment represents the API handler to
// update any deployment stored in the database.
func UpdateDeployment(c *gin.Context) {
// nolint: lll // ignore long line length due to return message
c.JSON(http.StatusNotImplemented, "The server does not support the functionality required to fulfill the request.")
}
2 changes: 0 additions & 2 deletions api/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ import (
// Authenticate represents the API handler to
// process a user logging in to Vela from
// the API or UI.
//
// nolint: funlen // ignore function length due to comments
func Authenticate(c *gin.Context) {
var err error

Expand Down
Loading