Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .golangci.yml #44

Merged
merged 13 commits into from
Dec 30, 2024
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ jobs:

- name: Test
run: go test -race -cover ./...

- name: Lint
uses: golangci/golangci-lint-action@v6

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Run golangci linters
uses: golangci/golangci-lint-action@v6
9 changes: 9 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
linters:
disable-all: true
enable:
- errcheck # Errcheck is a program for checking for unchecked errors in Go code.
- ineffassign # Detects when assignments to existing variables are not used.
- govet # Vet examines Go source code and reports suspicious constructs.
- staticcheck # It's a set of rules from staticcheck.dev
- unused # Checks Go code for unused constants, variables, functions and types.
disable:
2 changes: 1 addition & 1 deletion cmd/bunster/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func buildCMD(_ context.Context, cmd *cli.Command) error {
}

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

gocmd := exec.Command("go", "build", "-o", "build.bin")
gocmd.Stdin = os.Stdin
Expand Down
4 changes: 1 addition & 3 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ func Generate(script ast.Script) ir.Program {
}
}

type generator struct {
program ir.Program
}
type generator struct {}

type InstructionBuffer []ir.Instruction

Expand Down
Loading