Skip to content

Commit 0b26856

Browse files
committed
improve lint
1 parent 06f7168 commit 0b26856

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
echo "${{ toJSON(steps.filter )}}"
9494
9595
lint:
96-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
96+
# golangci-lint is heavily parallelizable.
97+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-32vcpu-ubuntu-2204' || 'ubuntu-latest' }}
9798
steps:
9899
- name: Checkout
99100
uses: actions/checkout@v3
@@ -102,7 +103,7 @@ jobs:
102103

103104
- uses: ./.github/actions/setup-node
104105

105-
# Check for any typos!
106+
# Check for any typos
106107
- name: Check for typos
107108
uses: crate-ci/typos@v1.14.12
108109
with:
@@ -115,28 +116,16 @@ jobs:
115116
cargo install typos-cli
116117
typos -c .github/workflows/typos.toml -w"
117118
118-
# Check for Go linting errors!
119-
- name: install golangci-lint
120-
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
121-
122-
- name: make lint
123-
run: |
124-
make --output-sync -j lint
125119
126-
# Make sure the Helm chart is linted!
120+
# Needed for helm chart linting
127121
- name: Install helm
128122
uses: azure/setup-helm@v3
129123
with:
130124
version: v3.9.2
131125

132-
- name: Lint Helm chart
126+
- name: make lint
133127
run: |
134-
cd helm
135-
make lint
136-
137-
# Ensure AGPL and Enterprise are separated!
138-
- name: Check for AGPL code importing Enterprise...
139-
run: ./scripts/check_enterprise_imports.sh
128+
make --output-sync -j lint
140129
141130
gen:
142131
timeout-minutes: 8

.golangci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ issues:
200200
max-same-issues: 0
201201

202202
run:
203-
concurrency: 4
204203
skip-dirs:
205204
- node_modules
206205
skip-files:

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,17 @@ else
402402
endif
403403
.PHONY: fmt/shfmt
404404

405-
lint: lint/shellcheck lint/go
405+
lint: lint/shellcheck lint/go lint/ts lint/helm lint/agpl
406406
.PHONY: lint
407407

408+
lint/ts:
409+
cd site
410+
yarn && yarn lint
411+
.PHONY: lint/ts
412+
408413
lint/go:
409414
./scripts/check_enterprise_imports.sh
415+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
410416
golangci-lint run
411417
.PHONY: lint/go
412418

@@ -416,6 +422,15 @@ lint/shellcheck: $(SHELL_SRC_FILES)
416422
shellcheck --external-sources $(SHELL_SRC_FILES)
417423
.PHONY: lint/shellcheck
418424

425+
lint/helm:
426+
cd helm
427+
make lint
428+
.PHONY: lint/helm
429+
430+
lint/agpl:
431+
./scripts/check_enterprise_imports.sh
432+
.PHONY: lint/agpl
433+
419434
# all gen targets should be added here and to gen/mark-fresh
420435
gen: \
421436
coderd/database/dump.sql \

enterprise/cli/root_internal_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package cli
33
import (
44
"testing"
55

6-
"github.com/coder/coder/cli"
76
"github.com/stretchr/testify/require"
87

8+
"github.com/coder/coder/cli"
9+
910
"github.com/coder/coder/cli/clibase"
1011

1112
"github.com/coder/coder/cli/clitest"

0 commit comments

Comments
 (0)