Skip to content

Commit

Permalink
1. fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
iasergunin committed Dec 16, 2023
1 parent 088c0d7 commit d79022e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/golangci/golangci-lint/issues/828
generate-matrix:
generate-pkgs-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -132,12 +132,12 @@ jobs:
DIRECTORIES=$(find . -not -path "*/vendor/*" -type f -name go.mod -exec sh -c 'echo $(dirname {})' \; | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${DIRECTORIES}" >> $GITHUB_OUTPUT
golangci-lint:
needs: generate-matrix
lint:
needs: generate-pkgs-matrix
runs-on: ubuntu-latest
strategy:
matrix:
modules: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
modules: ${{fromJson(needs.generate-pkgs-matrix.outputs.matrix)}}
steps:
- name: Fetch Repository
uses: actions/checkout@v4
Expand Down
10 changes: 2 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
linters-settings:
enable-all: true

run:
skip-dirs:
- trm/mock
Expand Down Expand Up @@ -68,9 +65,6 @@ linters:

issues:
exclude-use-default: false
errcheck:
check-type-assertions: true
check-blank: true
exclude:
- ST1000 # ST1000: at least one file in a package should have a package comment
exclude-rules:
Expand Down Expand Up @@ -110,13 +104,13 @@ issues:
- gochecknoglobals
source: "DefaultCtxGetter"
- &internal_text
path: ^internal
path: (^trm/internal|^internal)
text: "var-naming: don't use an underscore in package name"
- <<: *internal_text
text: "package-comments: should have a package comment"
- <<: *internal_text
text: "ST1003: should not use underscores in package names"
- path: (_test\.go|^internal)
- path: (_test\.go|^trm/internal|^internal)
linters:
- funlen
- gochecknoglobals
Expand Down
4 changes: 2 additions & 2 deletions sh/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ cd ../
ROOT=$(pwd)

echo "\ntrm"
cd trm && golangci-lint run -c $ROOT/.golangci.yml --timeout=2m $@
cd trm && golangci-lint run -c $ROOT/.golangci.yml --timeout=2m --path-prefix=trm $@
cd $ROOT

for driver in $drivers; do
if [ -d "$driver" ]; then
echo "\n$driver"
cd $driver && golangci-lint run -c $ROOT/.golangci.yml --timeout=2m $@
cd $driver && golangci-lint run -c $ROOT/.golangci.yml --timeout=2m --path-prefix=$driver $@

cd $ROOT
fi
Expand Down

0 comments on commit d79022e

Please sign in to comment.