Skip to content

Commit 7ae7eb9

Browse files
Merge pull request #44 from yassinebenaid/setup-golangci
Create .golangci.yml
2 parents dc9e6d0 + 751fced commit 7ae7eb9

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,19 @@ jobs:
2525

2626
- name: Test
2727
run: go test -race -cover ./...
28+
29+
- name: Lint
30+
uses: golangci/golangci-lint-action@v6
31+
32+
lint:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Set up Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version: 1.22
41+
42+
- name: Run golangci linters
43+
uses: golangci/golangci-lint-action@v6

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
- errcheck # Errcheck is a program for checking for unchecked errors in Go code.
5+
- ineffassign # Detects when assignments to existing variables are not used.
6+
- govet # Vet examines Go source code and reports suspicious constructs.
7+
- staticcheck # It's a set of rules from staticcheck.dev
8+
- unused # Checks Go code for unused constants, variables, functions and types.
9+
disable:

cmd/bunster/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func buildCMD(_ context.Context, cmd *cli.Command) error {
5252
}
5353

5454
// we ignore the error, because this is just an optional step that shouldn't stop us from building the binary
55-
exec.Command("gofmt", "-w", wd).Run()
55+
_ = exec.Command("gofmt", "-w", wd).Run()
5656

5757
gocmd := exec.Command("go", "build", "-o", "build.bin")
5858
gocmd.Stdin = os.Stdin

generator/generator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ func Generate(script ast.Script) ir.Program {
2020
}
2121
}
2222

23-
type generator struct {
24-
program ir.Program
25-
}
23+
type generator struct {}
2624

2725
type InstructionBuffer []ir.Instruction
2826

0 commit comments

Comments
 (0)