Skip to content

Commit 619df23

Browse files
authored
chore: fix linting issues and generated files (#10317)
1 parent 492da15 commit 619df23

File tree

9 files changed

+22
-20
lines changed

9 files changed

+22
-20
lines changed

.github/actions/setup-sqlc/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ runs:
55
using: "composite"
66
steps:
77
- name: Setup sqlc
8-
uses: sqlc-dev/setup-sqlc@v3
8+
uses: sqlc-dev/setup-sqlc@v4
99
with:
1010
sqlc-version: "1.20.0"

Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ lint: lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
419419

420420
lint/site-icons:
421421
./scripts/check_site_icons.sh
422-
423422
.PHONY: lint/site-icons
424423

425424
lint/ts:
@@ -517,6 +516,8 @@ coderd/database/dump.sql: coderd/database/gen/dump/main.go $(wildcard coderd/dat
517516
go run ./coderd/database/gen/dump/main.go
518517

519518
# Generates Go code for querying the database.
519+
# coderd/database/queries.sql.go
520+
# coderd/database/models.go
520521
coderd/database/querier.go: coderd/database/sqlc.yaml coderd/database/dump.sql $(wildcard coderd/database/queries/*.sql)
521522
./coderd/database/generate.sh
522523

@@ -539,19 +540,18 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
539540
--go-drpc_opt=paths=source_relative \
540541
./provisionerd/proto/provisionerd.proto
541542

542-
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
543-
go run ./scripts/apitypings/ > site/src/api/typesGenerated.ts
544-
cd site
545-
pnpm run format:types ./src/api/typesGenerated.ts
543+
site/src/api/typesGenerated.ts: $(wildcard scripts/apitypings/*) $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
544+
go run ./scripts/apitypings/ > $@
545+
pnpm run format:write:only "$@"
546546

547547
site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go
548548
cd site
549549
../scripts/pnpm_install.sh
550550
pnpm run gen:provisioner
551551

552-
site/src/theme/icons.json: $(wildcard site/static/icon/*)
553-
go run ./scripts/gensite/ -icons $@
554-
pnpm run format:write:only $@
552+
site/src/theme/icons.json: $(wildcard scripts/gensite/*) $(wildcard site/static/icon/*)
553+
go run ./scripts/gensite/ -icons "$@"
554+
pnpm run format:write:only "$@"
555555

556556
examples/examples.gen.json: scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates)
557557
go run ./scripts/examplegen/main.go > examples/examples.gen.json

cli/templates.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package cli
33
import (
44
"time"
55

6-
"github.com/coder/pretty"
76
"github.com/google/uuid"
87
"golang.org/x/xerrors"
98

9+
"github.com/coder/pretty"
10+
1011
"github.com/coder/coder/v2/cli/clibase"
1112
"github.com/coder/coder/v2/cli/cliui"
1213
"github.com/coder/coder/v2/codersdk"

cli/templateversionarchive.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import (
66
"strings"
77
"time"
88

9-
"github.com/coder/pretty"
109
"golang.org/x/xerrors"
1110

11+
"github.com/coder/pretty"
12+
1213
"github.com/coder/coder/v2/cli/clibase"
1314
"github.com/coder/coder/v2/cli/cliui"
1415
"github.com/coder/coder/v2/codersdk"

cli/templateversions.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import (
55
"strings"
66
"time"
77

8-
"github.com/coder/pretty"
98
"github.com/google/uuid"
109
"golang.org/x/xerrors"
1110

11+
"github.com/coder/pretty"
12+
1213
"github.com/coder/coder/v2/cli/clibase"
1314
"github.com/coder/coder/v2/cli/cliui"
1415
"github.com/coder/coder/v2/codersdk"

coderd/database/generate.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
2121
sqlc generate
2222

2323
first=true
24-
for fi in queries/*.sql.go; do
24+
files=$(find ./queries/ -type f -name "*.sql.go" | LC_ALL=C sort)
25+
for fi in $files; do
2526
# Find the last line from the imports section and add 1. We have to
2627
# disable pipefail temporarily to avoid ERRPIPE errors when piping into
2728
# `head -n1`.
@@ -56,7 +57,7 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
5657
go mod download
5758
go run golang.org/x/tools/cmd/goimports@latest -w queries.sql.go
5859

59-
go run ../../scripts/dbgen/main.go
60+
go run ../../scripts/dbgen
6061
# This will error if a view is broken.
6162
go test -run=TestViewSubset
6263
)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "coder",
44
"version": "0.0.0",
55
"scripts": {
6-
"format:write:only": "pnpm exec prettier --write"
6+
"format:write:only": "prettier --cache --write"
77
},
88
"devDependencies": {
99
"prettier": "3.0.0"

site/build/tsconfig.tsbuildinfo

-1
This file was deleted.

site/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
"check:all": "pnpm format:check && pnpm lint && pnpm test",
1111
"chromatic": "chromatic",
1212
"dev": "vite",
13-
"format:check": "pnpm exec prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
14-
"format:types": "pnpm exec prettier --cache --write './src/api/typesGenerated.ts'",
15-
"format:write": "pnpm exec prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
16-
"format:write:only": "pnpm exec prettier --write",
13+
"format:check": "prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
14+
"format:write": "prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
15+
"format:write:only": "prettier --cache --write",
1716
"lint": "pnpm typegen && pnpm run lint:types && pnpm exec jest --selectProjects lint",
1817
"lint:fix": "FIX=true pnpm lint",
1918
"lint:types": "tsc --noEmit",

0 commit comments

Comments
 (0)