chore: fix linting issues and generated files (#10317)

This commit is contained in:
Kayla Washburn 2023-10-17 14:41:35 -06:00 committed by GitHub
parent 492da15890
commit 619df23ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 20 deletions

View File

@ -5,6 +5,6 @@ runs:
using: "composite"
steps:
- name: Setup sqlc
uses: sqlc-dev/setup-sqlc@v3
uses: sqlc-dev/setup-sqlc@v4
with:
sqlc-version: "1.20.0"

View File

@ -419,7 +419,6 @@ lint: lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
lint/site-icons:
./scripts/check_site_icons.sh
.PHONY: lint/site-icons
lint/ts:
@ -517,6 +516,8 @@ coderd/database/dump.sql: coderd/database/gen/dump/main.go $(wildcard coderd/dat
go run ./coderd/database/gen/dump/main.go
# Generates Go code for querying the database.
# coderd/database/queries.sql.go
# coderd/database/models.go
coderd/database/querier.go: coderd/database/sqlc.yaml coderd/database/dump.sql $(wildcard coderd/database/queries/*.sql)
./coderd/database/generate.sh
@ -539,19 +540,18 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
--go-drpc_opt=paths=source_relative \
./provisionerd/proto/provisionerd.proto
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
go run ./scripts/apitypings/ > site/src/api/typesGenerated.ts
cd site
pnpm run format:types ./src/api/typesGenerated.ts
site/src/api/typesGenerated.ts: $(wildcard scripts/apitypings/*) $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
go run ./scripts/apitypings/ > $@
pnpm run format:write:only "$@"
site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go
cd site
../scripts/pnpm_install.sh
pnpm run gen:provisioner
site/src/theme/icons.json: $(wildcard site/static/icon/*)
go run ./scripts/gensite/ -icons $@
pnpm run format:write:only $@
site/src/theme/icons.json: $(wildcard scripts/gensite/*) $(wildcard site/static/icon/*)
go run ./scripts/gensite/ -icons "$@"
pnpm run format:write:only "$@"
examples/examples.gen.json: scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates)
go run ./scripts/examplegen/main.go > examples/examples.gen.json

View File

@ -3,10 +3,11 @@ package cli
import (
"time"
"github.com/coder/pretty"
"github.com/google/uuid"
"golang.org/x/xerrors"
"github.com/coder/pretty"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/cliui"
"github.com/coder/coder/v2/codersdk"

View File

@ -6,9 +6,10 @@ import (
"strings"
"time"
"github.com/coder/pretty"
"golang.org/x/xerrors"
"github.com/coder/pretty"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/cliui"
"github.com/coder/coder/v2/codersdk"

View File

@ -5,10 +5,11 @@ import (
"strings"
"time"
"github.com/coder/pretty"
"github.com/google/uuid"
"golang.org/x/xerrors"
"github.com/coder/pretty"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/cliui"
"github.com/coder/coder/v2/codersdk"

View File

@ -21,7 +21,8 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
sqlc generate
first=true
for fi in queries/*.sql.go; do
files=$(find ./queries/ -type f -name "*.sql.go" | LC_ALL=C sort)
for fi in $files; do
# Find the last line from the imports section and add 1. We have to
# disable pipefail temporarily to avoid ERRPIPE errors when piping into
# `head -n1`.
@ -56,7 +57,7 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
go mod download
go run golang.org/x/tools/cmd/goimports@latest -w queries.sql.go
go run ../../scripts/dbgen/main.go
go run ../../scripts/dbgen
# This will error if a view is broken.
go test -run=TestViewSubset
)

View File

@ -3,7 +3,7 @@
"name": "coder",
"version": "0.0.0",
"scripts": {
"format:write:only": "pnpm exec prettier --write"
"format:write:only": "prettier --cache --write"
},
"devDependencies": {
"prettier": "3.0.0"

File diff suppressed because one or more lines are too long

View File

@ -10,10 +10,9 @@
"check:all": "pnpm format:check && pnpm lint && pnpm test",
"chromatic": "chromatic",
"dev": "vite",
"format:check": "pnpm exec prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
"format:types": "pnpm exec prettier --cache --write './src/api/typesGenerated.ts'",
"format:write": "pnpm exec prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
"format:write:only": "pnpm exec prettier --write",
"format:check": "prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
"format:write": "prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
"format:write:only": "prettier --cache --write",
"lint": "pnpm typegen && pnpm run lint:types && pnpm exec jest --selectProjects lint",
"lint:fix": "FIX=true pnpm lint",
"lint:types": "tsc --noEmit",