-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding golangci-lint Linter to CI (#28)
- Loading branch information
1 parent
0188d1c
commit aed7699
Showing
16 changed files
with
161 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: golangci-lint step | ||
description: golangci-lint step | ||
inputs: | ||
linters: | ||
description: Linter to run | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Generating templ files | ||
run: | | ||
templ generate | ||
shell: bash | ||
|
||
- name: prepping lint commands | ||
id: set-command | ||
run: | | ||
export LINTERS="${{ inputs.linters }}" | ||
export LINTER_CMD="golangci-lint run --disable-all -E ${LINTERS//;/ -E }" | ||
echo "linter_cmd=${LINTER_CMD}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: running the linter command | ||
run: eval ${{ steps.set-command.outputs.linter_cmd }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Fail Fast | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
linters: | ||
name: Linters 🧑🔬 | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: mattgomes28/urchin-golang:0.2 | ||
options: --user 1001 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/workflows/actions/golangci-lint | ||
name: Running Linters 🧪 | ||
with: | ||
linters: errcheck;staticcheck;unused;gosimple;gofmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.