summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-04-20 04:08:01 +0200
committerGitHub <noreply@github.com>2023-04-19 22:08:01 -0400
commit938b59199480d1b3730388982eb87d592e976849 (patch)
treefcbbeea0c67dca1cda1ef87a6b3c0748105a8610 /modules
parent594efb9b669fb12e8a0306f76c740fa72c1a80f1 (diff)
downloadgitea-938b59199480d1b3730388982eb87d592e976849.tar.gz
gitea-938b59199480d1b3730388982eb87d592e976849.zip
Remove most path-based golangci exclusions (#24214)
They are non-obvious and do not survive refactor. Will replace with `//nolint` comments after CI results are in.
Diffstat (limited to 'modules')
-rw-r--r--modules/graceful/manager_windows.go2
-rw-r--r--modules/log/event.go4
-rw-r--r--modules/log/file.go4
-rw-r--r--modules/log/log.go4
-rw-r--r--modules/log/logger.go20
-rw-r--r--modules/log/multichannel.go2
-rw-r--r--modules/log/writer.go4
7 files changed, 20 insertions, 20 deletions
diff --git a/modules/graceful/manager_windows.go b/modules/graceful/manager_windows.go
index 212ddf437c..f3606084aa 100644
--- a/modules/graceful/manager_windows.go
+++ b/modules/graceful/manager_windows.go
@@ -96,7 +96,7 @@ func (g *Manager) start() {
run := svc.Run
//lint:ignore SA1019 We use IsAnInteractiveSession because IsWindowsService has a different permissions profile
- isAnInteractiveSession, err := svc.IsAnInteractiveSession()
+ isAnInteractiveSession, err := svc.IsAnInteractiveSession() //nolint:staticcheck
if err != nil {
log.Error("Unable to ascertain if running as an Windows Service: %v", err)
return
diff --git a/modules/log/event.go b/modules/log/event.go
index 4466f7ff34..d23e56807b 100644
--- a/modules/log/event.go
+++ b/modules/log/event.go
@@ -82,7 +82,7 @@ func (l *ChannelledLog) Start() {
l.closeLogger()
return
}
- l.loggerProvider.LogEvent(event)
+ l.loggerProvider.LogEvent(event) //nolint:errcheck
case _, ok := <-l.flush:
if !ok {
l.closeLogger()
@@ -119,7 +119,7 @@ func (l *ChannelledLog) emptyQueue() bool {
if !ok {
return false
}
- l.loggerProvider.LogEvent(event)
+ l.loggerProvider.LogEvent(event) //nolint:errcheck
default:
return true
}
diff --git a/modules/log/file.go b/modules/log/file.go
index 16fe26f84d..55147ffac8 100644
--- a/modules/log/file.go
+++ b/modules/log/file.go
@@ -181,7 +181,7 @@ func (log *FileLogger) DoRotate() error {
}
if log.Compress {
- go compressOldLogFile(fname, log.CompressionLevel)
+ go compressOldLogFile(fname, log.CompressionLevel) //nolint:errcheck
}
// re-start logger
@@ -216,7 +216,7 @@ func compressOldLogFile(fname string, compressionLevel int) error {
if err != nil {
zw.Close()
fw.Close()
- util.Remove(fname + ".gz")
+ util.Remove(fname + ".gz") //nolint:errcheck
return err
}
reader.Close()
diff --git a/modules/log/log.go b/modules/log/log.go
index 9057cda37e..eee2728bf6 100644
--- a/modules/log/log.go
+++ b/modules/log/log.go
@@ -245,7 +245,7 @@ func Close() {
func Log(skip int, level Level, format string, v ...interface{}) {
l, ok := NamedLoggers.Load(DEFAULT)
if ok {
- l.Log(skip+1, level, format, v...)
+ l.Log(skip+1, level, format, v...) //nolint:errcheck
}
}
@@ -273,7 +273,7 @@ func (l *LoggerAsWriter) Write(p []byte) (int, error) {
for _, logger := range l.ourLoggers {
// Skip = 3 because this presumes that we have been called by log.Println()
// If the caller has used log.Output or the like this will be wrong
- logger.Log(3, l.level, string(p))
+ logger.Log(3, l.level, string(p)) //nolint:errcheck
}
return len(p), nil
}
diff --git a/modules/log/logger.go b/modules/log/logger.go
index 56e39c392e..71949e29b8 100644
--- a/modules/log/logger.go
+++ b/modules/log/logger.go
@@ -53,7 +53,7 @@ type LevelLoggerLogger struct {
// Trace records trace log
func (l *LevelLoggerLogger) Trace(format string, v ...interface{}) {
- l.Log(1, TRACE, format, v...)
+ l.Log(1, TRACE, format, v...) //nolint:errcheck
}
// IsTrace returns true if the logger is TRACE
@@ -63,7 +63,7 @@ func (l *LevelLoggerLogger) IsTrace() bool {
// Debug records debug log
func (l *LevelLoggerLogger) Debug(format string, v ...interface{}) {
- l.Log(1, DEBUG, format, v...)
+ l.Log(1, DEBUG, format, v...) //nolint:errcheck
}
// IsDebug returns true if the logger is DEBUG
@@ -73,7 +73,7 @@ func (l *LevelLoggerLogger) IsDebug() bool {
// Info records information log
func (l *LevelLoggerLogger) Info(format string, v ...interface{}) {
- l.Log(1, INFO, format, v...)
+ l.Log(1, INFO, format, v...) //nolint:errcheck
}
// IsInfo returns true if the logger is INFO
@@ -83,7 +83,7 @@ func (l *LevelLoggerLogger) IsInfo() bool {
// Warn records warning log
func (l *LevelLoggerLogger) Warn(format string, v ...interface{}) {
- l.Log(1, WARN, format, v...)
+ l.Log(1, WARN, format, v...) //nolint:errcheck
}
// IsWarn returns true if the logger is WARN
@@ -93,12 +93,12 @@ func (l *LevelLoggerLogger) IsWarn() bool {
// Error records error log
func (l *LevelLoggerLogger) Error(format string, v ...interface{}) {
- l.Log(1, ERROR, format, v...)
+ l.Log(1, ERROR, format, v...) //nolint:errcheck
}
// ErrorWithSkip records error log from "skip" calls back from this function
func (l *LevelLoggerLogger) ErrorWithSkip(skip int, format string, v ...interface{}) {
- l.Log(skip+1, ERROR, format, v...)
+ l.Log(skip+1, ERROR, format, v...) //nolint:errcheck
}
// IsError returns true if the logger is ERROR
@@ -108,12 +108,12 @@ func (l *LevelLoggerLogger) IsError() bool {
// Critical records critical log
func (l *LevelLoggerLogger) Critical(format string, v ...interface{}) {
- l.Log(1, CRITICAL, format, v...)
+ l.Log(1, CRITICAL, format, v...) //nolint:errcheck
}
// CriticalWithSkip records critical log from "skip" calls back from this function
func (l *LevelLoggerLogger) CriticalWithSkip(skip int, format string, v ...interface{}) {
- l.Log(skip+1, CRITICAL, format, v...)
+ l.Log(skip+1, CRITICAL, format, v...) //nolint:errcheck
}
// IsCritical returns true if the logger is CRITICAL
@@ -123,14 +123,14 @@ func (l *LevelLoggerLogger) IsCritical() bool {
// Fatal records fatal log and exit the process
func (l *LevelLoggerLogger) Fatal(format string, v ...interface{}) {
- l.Log(1, FATAL, format, v...)
+ l.Log(1, FATAL, format, v...) //nolint:errcheck
l.Close()
os.Exit(1)
}
// FatalWithSkip records fatal log from "skip" calls back from this function and exits the process
func (l *LevelLoggerLogger) FatalWithSkip(skip int, format string, v ...interface{}) {
- l.Log(skip+1, FATAL, format, v...)
+ l.Log(skip+1, FATAL, format, v...) //nolint:errcheck
l.Close()
os.Exit(1)
}
diff --git a/modules/log/multichannel.go b/modules/log/multichannel.go
index 8ccb08179c..6b8a9b8246 100644
--- a/modules/log/multichannel.go
+++ b/modules/log/multichannel.go
@@ -99,6 +99,6 @@ func (l *MultiChannelledLogger) SendLog(level Level, caller, filename string, li
time: time.Now(),
stacktrace: stack,
}
- l.LogEvent(event)
+ l.LogEvent(event) //nolint:errcheck
return nil
}
diff --git a/modules/log/writer.go b/modules/log/writer.go
index ac4b3c8c4e..61f1d866ee 100644
--- a/modules/log/writer.go
+++ b/modules/log/writer.go
@@ -202,7 +202,7 @@ func (logger *WriterLogger) createMsg(buf *[]byte, event *Event) {
(&protectedANSIWriter{
w: &baw,
mode: pawMode,
- }).Write(msg)
+ }).Write(msg) //nolint:errcheck
*buf = baw
if event.stacktrace != "" && logger.StacktraceLevel <= event.level {
@@ -249,7 +249,7 @@ func (logger *WriterLogger) Match(event *Event) bool {
(&protectedANSIWriter{
w: &baw,
mode: removeColor,
- }).Write([]byte(event.msg))
+ }).Write([]byte(event.msg)) //nolint:errcheck
msg = baw
return logger.regexp.Match(msg)
}