<#614 Add linter for the codebase> Issue created b...
# osctrl
g
#614 Add linter for the codebase Issue created by zhuoyuan-liu To improve code quality, maintainability, and consistency across the project, we should enable
golangci-lint
. This tool provides a comprehensive set of linters that catch potential issues early, enforce best practices, and reduce technical debt. We can start with a simple linter by creating a file
.golangci.yml
in the root folder and put the following in the file. Simply run
golangci-lint run
locally. # options for analysis running run: # timeout for analysis, e.g. 30s, 5m, default is 1m deadline: 5m # exit code when at least one issue was found, default is 1 issues-exit-code: 1 linters: enable: - errcheck - goconst - goimports - gosimple - govet - ineffassign - staticcheck - typecheck - unused - misspell - errorlint - gocritic - gofmt We can also add the following to the pipeline to check if the code followed the linter:
Copy code
- name: Lint
        uses: golangci/golangci-lint-action@v6
        with:
          version: v1.63
          args: --timeout=5m
jmpsec/osctrl