Skip to content

Commit

Permalink
fix(ci): fail ci on lint issues; enable nolintlint (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Sep 28, 2023
1 parent 851c1b0 commit 6c11a72
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=0
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
args: --issues-exit-code=1
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ linters:
- gosec
- ifshort
- misspell
- nolintlint
- prealloc
- revive
- rowserrcheck
Expand Down
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (l *Logger) log(level Level, msg interface{}, keyvals ...interface{}) {
}

// WriteTo will reset the buffer
l.b.WriteTo(l.w) // nolint: errcheck
l.b.WriteTo(l.w) //nolint: errcheck
}

// Helper marks the calling function as a helper
Expand Down
5 changes: 2 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ type CallerFormatter func(string, int, string) string

// ShortCallerFormatter is a caller formatter that returns the last 2 levels of the path
// and line number.
func ShortCallerFormatter(file string, line int, funcName string) string {
func ShortCallerFormatter(file string, line int, _ string) string {
return fmt.Sprintf("%s:%d", trimCallerPath(file, 2), line)
}

// LongCallerFormatter is a caller formatter that returns the full path and line number.
func LongCallerFormatter(file string, line int, funcName string) string {
func LongCallerFormatter(file string, line int, _ string) string {
return fmt.Sprintf("%s:%d", file, line)
}

Expand All @@ -58,5 +58,4 @@ type Options struct {
Fields []interface{}
// Formatter is the formatter for the logger. The default is TextFormatter.
Formatter Formatter

}

0 comments on commit 6c11a72

Please sign in to comment.