Skip to content

Commit

Permalink
[chore] Add lint/editor/pipeline configs
Browse files Browse the repository at this point in the history
  • Loading branch information
BioCrossCoder committed Apr 30, 2024
1 parent dc48327 commit 3533f72
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/github-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Automatic Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: actions/setup-go@v4
with:
go-version: 1.22

- run: go test -v -coverprofile=cover.out ./...
- run: go tool cover -html=cover.out -o cover.html
- run: rm cover.out
- uses: actions/upload-artifact@v3
with:
name: ut-coverage
files: ./cover.html
80 changes: 80 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
run:
issues-exit-code: 0
tests: true

output:
format: checkstyle

linters-settings:
funlen:
lines: 200
statements: 80
goconst:
min-len: 3
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 15
goimports:
local-prefixes: flex
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
lll:
line-length: 200
misspell:
locale: US

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- ineffassign
- lll
- misspell
- noctx
- rowserrcheck
- revive
- exportloopref
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace

issues:
exclude-use-default: false
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.acceptSuggestionOnEnter": "off",
"editor.formatOnSave": true,
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
]
}

0 comments on commit 3533f72

Please sign in to comment.