diff --git a/.golangci.yaml b/.golangci.yaml index c735a06170235..bf8f0b9becae5 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -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. diff --git a/cmd/coder/main.go b/cmd/coder/main.go index 0fcbf38721947..4a575e5a3af5b 100644 --- a/cmd/coder/main.go +++ b/cmd/coder/main.go @@ -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()) diff --git a/scripts/migrate-test/main.go b/scripts/migrate-test/main.go index 889bc89f9dfcf..a0c03483e9e9c 100644 --- a/scripts/migrate-test/main.go +++ b/scripts/migrate-test/main.go @@ -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") }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: