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

Added golangci-lint and multiple fixes for all kind of checks #84

Merged
merged 6 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixed issue with code generation before running static checks
  • Loading branch information
sparshev committed Sep 6, 2024
commit 9cd33d10bbe099a2db7842863f39fcbfd0d1b394
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ jobs:
checks: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: stable # Linter will use go.mod file to adjust the rules properly

- name: Generate code
run: ONLYGEN=1 ./build.sh

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ PATH="$gopath/bin:$PATH" go generate -v ./lib/...
sed -i.bak 's/^type LabelDefinitions = /type LabelDefinitions /' lib/openapi/types/types.gen.go
rm -f lib/openapi/types/types.gen.go.bak

# If ONLYGEN is specified - skip the build
[ -z "$ONLYGEN" ] || exit 0

# Prepare version number as overrides during link
mod_name=$(grep '^module' "${root_dir}/go.mod" | cut -d' ' -f 2)
git_version="$(git describe --tags --match 'v*')$([ "$(git diff)" = '' ] || echo '-dirty')"
Expand Down