forked from golang/glog
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: run golangci-lint via action
The main advantage is that issues get posted as annotations, which makes them easier to find when looking at a diff for a PR. While at it, golangci-lint gets invoked so that it runs in its default configuration plus the linters that were enabled explicitly before (misspell, gofmt, revive as replacement for golint). It also gets applied to the examples package.
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 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,24 @@ | ||
name: Run lint | ||
|
||
on: [ push, pull_request ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
matrix: | ||
path: | ||
- . | ||
- examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
# version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: latest | ||
working-directory: ${{ matrix.path }} |
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,6 @@ | ||
linters: | ||
disable-all: true | ||
enable: # sorted alphabetical | ||
- gofmt | ||
- misspell | ||
- revive |