Skip to content

Enable Linting #4492

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ jobs:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

# TODO fix this step (cant find the path to golangci.yml)
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
continue-on-error: true # we dont want to enforce just yet
with:
version: v1.52.2
version: latest
Copy link
Preview

Copilot AI Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the 'latest' version for the golangci-lint action may lead to unpredictable builds. Consider pinning to a specific version for more reproducible CI behavior.

Suggested change
version: latest
version: v1.50.1

Copilot uses AI. Check for mistakes.

args: --timeout=15m --config=.golangci.yml
skip-pkg-cache: true
skip-build-cache: true
working-directory: steampipe
skip-cache: true

- name: Run CLI Unit Tests
run: |
Expand Down
32 changes: 30 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ linters:
- unused
# other rules
- asasalint
- depguard
- asciicheck
- bidichk
- durationcheck
- exportloopref
- forbidigo
- gocritic
- gocheckcompilerdirectives
Expand All @@ -31,14 +31,42 @@ linters-settings:
require-explanation: true
require-specific: true

forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- "^(fmt\\.Fprint(|f|ln)|print|println)$"
- '^zap\.Error$'
- '^grpc\.(Header|Trailer)$' # easy to misuse and create a data race

gocritic:
disabled-checks:
- ifElseChain # style
- singleCaseSwitch # style & it's actually not a bad idea to use single case switch in some cases
- assignOp # style
- commentFormatting # style

depguard:
rules:
# Name of a rule.
main:
# List of file globs that will match this list of settings to compare against.
# Default: $all
# files:
# - "!**/*_a _file.go"
# List of allowed packages.
# allow:
# - $gostd
# - github.com/OpenPeeDeeP
# Packages that are not allowed where the value is a suggestion.
deny:
- pkg: "go.uber.org/zap"
desc: do not use Uber zap directly, use the fplog package instead
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package

run:
timeout: 5m
skip-dirs:

issues:
exclude-dirs:
- "tests/acceptance"
Loading