Skip to content

Commit 038ede0

Browse files
committed
fix: add lint and format checks to ci
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent ec456b4 commit 038ede0

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/validate.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,26 @@ jobs:
227227
run: |
228228
cd test/tests
229229
go test -c
230+
231+
lint-tests:
232+
runs-on: ubuntu-latest
233+
steps:
234+
- uses: actions/checkout@v5
235+
with:
236+
fetch-depth: 0
237+
- name: install-nix
238+
run: |
239+
curl -L https://nixos.org/nix/install | sh
240+
source /home/runner/.nix-profile/etc/profile.d/nix.sh
241+
nix --version
242+
which nix
243+
- name: compile-check
244+
shell: /home/runner/.nix-profile/bin/nix develop --ignore-environment --extra-experimental-features nix-command --extra-experimental-features flakes --keep HOME --keep SSH_AUTH_SOCK --keep GITHUB_TOKEN --keep AWS_ROLE --keep AWS_REGION --keep AWS_DEFAULT_REGION --keep AWS_ACCESS_KEY_ID --keep AWS_SECRET_ACCESS_KEY --keep AWS_SESSION_TOKEN --keep UPDATECLI_GPGTOKEN --keep UPDATECLI_GITHUB_TOKEN --keep UPDATECLI_GITHUB_ACTOR --keep GPG_SIGNING_KEY --keep NIX_SSL_CERT_FILE --keep NIX_ENV_LOADED --keep TERM --command bash -e {0}
245+
run: |
246+
cd test/tests
247+
echo "checking tests for go lint errors..."
248+
if ! golangci-lint run; then echo "lint failed..."; exit 1; fi
249+
echo "lint errors complete"
250+
echo "checking for format issues"
251+
if [ -n "$(gofmt -l -s -d .)" ]; then echo "some files need formatting..."; exit 1; fi
252+
echo "formatting check complete"

aspell_custom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ oci
99
eks
1010
aks
1111
readme
12+
ci

test/tests/.golangci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: "2"
2+
linters:
3+
default: none
4+
enable:
5+
- copyloopvar
6+
- durationcheck
7+
- errcheck
8+
- forcetypeassert
9+
- godot
10+
- ineffassign
11+
- makezero
12+
- misspell
13+
- nilerr
14+
- predeclared
15+
- staticcheck
16+
- unconvert
17+
- unparam
18+
- unused
19+
- usetesting
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
paths:
28+
- third_party$
29+
- builtin$
30+
- examples$
31+
issues:
32+
max-issues-per-linter: 0
33+
max-same-issues: 0
34+
formatters:
35+
enable:
36+
- gofmt
37+
exclusions:
38+
generated: lax
39+
paths:
40+
- third_party$
41+
- builtin$
42+
- examples$

0 commit comments

Comments
 (0)