mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2025-03-31 11:31:21 +01:00
add golang-ci config + action
This commit is contained in:
parent
29e6c2e8aa
commit
585b4d4c14
29
.github/workflows/golang-ci.yml
vendored
Normal file
29
.github/workflows/golang-ci.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- '**.go'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- '**.go'
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request'
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24'
|
||||
- name: Install golangci-lint
|
||||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
- name: Run golangci-lint
|
||||
run: golangci-lint run ./...
|
54
.golangci.yml
Normal file
54
.golangci.yml
Normal file
@ -0,0 +1,54 @@
|
||||
run:
|
||||
# timeout for analysis, e.g. 30s, 3m, default is 1m
|
||||
timeout: 3m
|
||||
# exclude test files
|
||||
tests: true
|
||||
|
||||
linters:
|
||||
# Set to true runs only fast linters.
|
||||
# Good option for 'lint on save', pre-commit hook or CI.
|
||||
fast: true
|
||||
|
||||
disable-all: true
|
||||
|
||||
enable:
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- unused
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- misspell
|
||||
- unparam
|
||||
- gosec
|
||||
- asciicheck
|
||||
- errname
|
||||
- gci
|
||||
- godot
|
||||
- goimports
|
||||
- revive
|
||||
|
||||
linters-settings:
|
||||
gofmt:
|
||||
rewrite-rules:
|
||||
- pattern: 'interface{}'
|
||||
replacement: 'any'
|
||||
- pattern: 'a[b:len(a)]'
|
||||
replacement: 'a[b:]'
|
||||
|
||||
misspell:
|
||||
locale: UK
|
||||
|
||||
errcheck:
|
||||
check-type-assertions: true
|
||||
|
||||
issues:
|
||||
max-same-issues: 0
|
||||
max-issues-per-linter: 0
|
||||
exclude-use-default: false
|
||||
exclude:
|
||||
# gosec: Duplicated errcheck checks
|
||||
- G104
|
||||
# gosec: integer overflow conversion int -> uint32
|
||||
- G115
|
Loading…
x
Reference in New Issue
Block a user