fix: correct spurious edits made during the lint fixing slog (#17113)

This commit is contained in:
Jon Ayers
2025-03-27 01:13:21 -05:00
committed by GitHub
parent 6bb4bdb9cb
commit 2dc99c8469
3 changed files with 17 additions and 29 deletions
+4 -27
View File
@@ -24,30 +24,19 @@ linters-settings:
enabled-checks:
# - appendAssign
# - appendCombine
- argOrder
# - assignOp
# - badCall
- badCond
- badLock
- badRegexp
- boolExprSimplify
# - builtinShadow
- builtinShadowDecl
- captLocal
- caseOrder
- codegenComment
# - commentedOutCode
- commentedOutImport
- commentFormatting
- defaultCaseOrder
- deferUnlambda
# - deprecatedComment
# - docStub
- dupArg
- dupBranchBody
- dupCase
- dupImport
- dupSubExpr
# - elseif
- emptyFallthrough
# - emptyStringTest
@@ -56,8 +45,6 @@ linters-settings:
# - exitAfterDefer
# - exposedSyncMutex
# - filepathJoin
- flagDeref
- flagName
- hexLiteral
# - httpNoBody
# - hugeParam
@@ -65,47 +52,36 @@ linters-settings:
# - importShadow
- indexAlloc
- initClause
- mapKey
- methodExprCall
# - nestingReduce
- newDeref
- nilValReturn
# - octalLiteral
- offBy1
# - paramTypeCombine
# - preferStringWriter
# - preferWriteByte
# - ptrToRefParam
# - rangeExprCopy
# - rangeValCopy
- regexpMust
- regexpPattern
# - regexpSimplify
- ruleguard
- singleCaseSwitch
- sloppyLen
# - sloppyReassign
- sloppyTypeAssert
- sortSlice
- sprintfQuotedString
- sqlQuery
# - stringConcatSimplify
# - stringXbytes
# - suspiciousSorting
- switchTrue
- truncateCmp
- typeAssertChain
# - typeDefFirst
- typeSwitchVar
# - typeUnparen
- underef
# - unlabelStmt
# - unlambda
# - unnamedResult
# - unnecessaryBlock
# - unnecessaryDefer
# - unslice
- valSwap
- weakCond
# - whyNoLint
# - wrapperFunc
@@ -208,7 +184,7 @@ issues:
- node_modules
- .git
skip-files:
exclude-files:
- scripts/rules.go
# Rules listed here: https://github.com/securego/gosec#available-rules
@@ -224,6 +200,9 @@ issues:
- path: scripts/*
linters:
- exhaustruct
- path: scripts/rules.go
linters:
- ALL
fix: true
max-issues-per-linter: 0
@@ -231,8 +210,6 @@ issues:
run:
timeout: 10m
skip-files:
- scripts/rules.go
# Over time, add more and more linters from
# https://golangci-lint.run/usage/linters/ as the code improves.
+11
View File
@@ -1,15 +1,26 @@
package main
import (
"fmt"
"os"
_ "time/tzdata"
tea "github.com/charmbracelet/bubbletea"
"github.com/coder/coder/v2/agent/agentexec"
_ "github.com/coder/coder/v2/buildinfo/resources"
"github.com/coder/coder/v2/cli"
)
func main() {
if len(os.Args) > 1 && os.Args[1] == "agent-exec" {
err := agentexec.CLI()
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
// This preserves backwards compatibility with an init function that is causing grief for
// web terminals using agent-exec + screen. See https://github.com/coder/coder/pull/15817
tea.InitTerminal()
var rootCmd cli.RootCmd
rootCmd.RunWithSubcommands(rootCmd.AGPL())
+2 -2
View File
@@ -95,12 +95,12 @@ func main() {
dumpBytesAfter, err := dbtestutil.PGDumpSchemaOnly(postgresURL)
if err != nil {
friendlyError(os.Stderr, err, migrateFromVersion, migrateToVersion)
panic("")
panic(err)
}
if diff := cmp.Diff(string(dumpBytesAfter), string(stripGenPreamble(expectedSchemaAfter))); diff != "" {
friendlyError(os.Stderr, xerrors.Errorf("Schema differs from expected after migration: %s", diff), migrateFromVersion, migrateToVersion)
panic("")
panic(err)
}
_, _ = fmt.Fprintf(os.Stderr, "OK\n")
}