Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-sekara committed Oct 23, 2024
1 parent 096bf05 commit 486d78a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
27 changes: 9 additions & 18 deletions .github/actions/golangci-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ runs:
using: composite
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
# We only need a full clone on merge_group events for golangci-lint.
fetch-depth: ${{ github.event_name == 'merge_group' && '0' || '1' }}"
- name: Setup Go
uses: ./.github/actions/setup-go
with:
Expand All @@ -53,23 +50,17 @@ runs:
working-directory: ${{ inputs.go-directory }}
shell: bash
run: go build ./...
- name: Set golangci-lint working directory
shell: bash
id: set-working-directory
# XXX: Don't use `.` default working directory here due to issues with the golangci-lint-action.
run: |
if [ "${{ inputs.go-directory }}" == "." ]; then
echo "golangci-lint-working-directory=" | tee -a $GITHUB_OUTPUT
else
echo "golangci-lint-working-directory=${{ inputs.go-directory }}" | tee -a $GITHUB_OUTPUT
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@38e1018663fa5173f3968ea0777460d3de38f256 # v5.3.0
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.60.3
only-new-issues: true
version: v1.59.1
# We already cache these directories in setup-go
skip-pkg-cache: true
skip-build-cache: true
# only-new-issues is only applicable to PRs, otherwise it is always set to false
only-new-issues: false # disabled for PRs due to unreliability
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
working-directory: ${{ steps.set-working-directory.outputs.golangci-lint-working-directory }}
working-directory: ${{ inputs.go-directory }}
- name: Print lint report artifact
if: failure()
shell: bash
Expand All @@ -89,4 +80,4 @@ runs:
hostname: ${{ inputs.gc-host }}
org-id: ${{ inputs.gc-org-id }}
this-job-name: ${{ inputs.name }}
continue-on-error: true
continue-on-error: true
13 changes: 6 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ linters-settings:
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
# - name: var-naming
- name: var-declaration
- name: package-comments
- name: range
Expand All @@ -93,7 +92,7 @@ linters-settings:
- name: struct-tag
# - name: string-format
- name: string-of-int
- name: range-val-address
# - name: range-val-address
- name: range-val-in-closure
- name: modifies-value-receiver
- name: modifies-parameter
Expand Down Expand Up @@ -128,9 +127,9 @@ linters-settings:
desc: Use github.com/stretchr/testify/mock instead
- pkg: github.com/test-go/testify/require
desc: Use github.com/stretchr/testify/require instead
# TODO https://smartcontract-it.atlassian.net/browse/BCI-2589
# - pkg: go.uber.org/multierr
# desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
# TODO https://smartcontract-it.atlassian.net/browse/BCI-2589
# - pkg: go.uber.org/multierr
# desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: gopkg.in/guregu/null.v1
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: gopkg.in/guregu/null.v2
Expand Down Expand Up @@ -166,4 +165,4 @@ issues:
- path: test
text: "^G404:"
linters:
- gosec
- gosec

0 comments on commit 486d78a

Please sign in to comment.