mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
golangci-lint configuration file
golangci-lint can run all the currently enabled linters, and as far as I can tell, does it in under 5 seconds as opposed to over 180 seconds (compare `time make cilint` and `time make lint`). Some of the linters that are listed in the "enabled" section but commented out looked like a good idea to me, and fairly low hanging fruit to fix, but they are not passing at the moment. All the linters covered in the current Makefile are run. TODO: - replace lint target in Makefile with golangci-lint - remove .github/workflow/errcheck.yml
This commit is contained in:
@@ -73,11 +73,12 @@ func (widget *Widget) generateQueueJobLine(id int64, parameters []sdk.Parameter,
|
||||
row[2] = pad(run, 7)
|
||||
row[3] = pad(prj+"/"+workflow+"/"+node, 40)
|
||||
|
||||
if status == sdk.StatusBuilding {
|
||||
switch {
|
||||
case status == sdk.StatusBuilding:
|
||||
row[1] = pad(fmt.Sprintf(" %s.%s ", executedJob.WorkerName, executedJob.WorkerID), 27)
|
||||
} else if bookedBy.ID != 0 {
|
||||
case bookedBy.ID != 0:
|
||||
row[1] = pad(fmt.Sprintf(" %s.%d ", bookedBy.Name, bookedBy.ID), 27)
|
||||
} else {
|
||||
default:
|
||||
row[1] = pad("", 27)
|
||||
}
|
||||
|
||||
|
||||
@@ -43,17 +43,18 @@ func (widget *Widget) displayStatus() string {
|
||||
)
|
||||
|
||||
for _, line := range status.Lines {
|
||||
if line.Status == sdk.MonitoringStatusWarn && strings.Contains(line.Component, "Global") {
|
||||
switch {
|
||||
case line.Status == sdk.MonitoringStatusWarn && strings.Contains(line.Component, "Global"):
|
||||
globalWarn = append(globalWarn, line.String())
|
||||
} else if line.Status != sdk.MonitoringStatusOK && strings.Contains(line.Component, "Global") {
|
||||
case line.Status != sdk.MonitoringStatusOK && strings.Contains(line.Component, "Global"):
|
||||
globalRed = append(globalRed, line.String())
|
||||
} else if strings.Contains(line.Component, "Global") {
|
||||
case strings.Contains(line.Component, "Global"):
|
||||
global = append(global, line.String())
|
||||
} else if line.Status == sdk.MonitoringStatusWarn {
|
||||
case line.Status == sdk.MonitoringStatusWarn:
|
||||
warn = append(warn, line.String())
|
||||
} else if line.Status == sdk.MonitoringStatusOK {
|
||||
case line.Status == sdk.MonitoringStatusOK:
|
||||
ok = append(ok, line.String())
|
||||
} else {
|
||||
default:
|
||||
red = append(red, line.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user