* Add golangci-lint config yaml and GitHub Actions workflows

* Update to Go 1.14
This commit is contained in:
Eric Wohltman 2020-06-23 22:15:31 -04:00 committed by GitHub
parent d134c5226d
commit c7291b6f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 158 additions and 1 deletions

33
.github/workflows/pullRequest.yml vendored Normal file
View File

@ -0,0 +1,33 @@
---
name: pull_request
"on": [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get install -y \
libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libsdl2-dev libasound2-dev \
> /dev/null 2>&1
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v1.2.1
with:
version: v1.27
- name: Run tests
run: go test -v -race ./...
- name: Build binary
run: go build .

36
.github/workflows/pushToMaster.yml vendored Normal file
View File

@ -0,0 +1,36 @@
---
name: build
"on":
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get install -y \
libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libsdl2-dev libasound2-dev \
> /dev/null 2>&1
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v1.2.1
with:
version: v1.27
- name: Run tests
run: go test -v -race ./...
- name: Build binary
run: go build .

88
.golangci.yml Normal file
View File

@ -0,0 +1,88 @@
---
linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/OpenDiablo2/OpenDiablo2
golint:
min-confidence: 0.8
govet:
check-shadowing: true
lll:
line-length: 140
maligned:
suggest-new: true
misspell:
locale: US
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godox
- gofmt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- maligned
- misspell
- nakedret
- prealloc
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- wsl
run:
timeout: 5m
skip-dirs:
- .github
- build
- web
issues:
max-same-issues: 0
exclude-use-default: false

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/OpenDiablo2/OpenDiablo2
go 1.12
go 1.14
require (
github.com/JoshVarga/blast v0.0.0-20180421040937-681c804fb9f0