Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

15 changes: 5 additions & 10 deletions .github/workflows/cq-checks.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
---
name: Basic checks

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.24

- name: Test
run: make test TEST_VERBOSE=1

- name: install tools
run: make tools-install

- name: Lint
run: make lint

- name: Code coverage
uses: codecov/codecov-action@v2.1.0
with:
file: coverage.txt
file: cp.out
32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
.vscode
# Binaries for programs and plugins
bin
build
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Outputs of the go coverage tool, static analysis etc.
*.out*

# Go workspace file
go.work
go.work.sum

coverage.txt
# Configurations
.env

# Data
data

# MacOS
.DS_Store

# IDEs and editors
.idea
.vscode
64 changes: 64 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
version: "2"

run:
tests: true

linters:
default: all
disable:
# restrictive
- exhaustruct
- varnamelen
- nlreturn
- funlen
- nonamedreturns
- gochecknoglobals
- wsl
- nakedret
- err113
# enable later
- wrapcheck
- revive
settings:
depguard:
rules:
main:
list-mode: strict
files:
- $all
allow:
- $gostd
- github.com/moderntv
- github.com/cespare/xxhash
- github.com/matryer/is

formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
- golines
settings:
golines:
max-len: 120
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

issues:
fix: true

output:
formats:
text:
path: stdout
tab:
path: golangci-lint.out
colors: false
html:
path: golanci-lint.out.html
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,10 @@ test:
$(if $(TEST_VERBOSE),-v,) \
-race \
-timeout 1h \
-coverprofile coverage.txt \
-coverprofile cp.out \
-run '$(TEST_RUN)' \
./...

.PHONY: lint
lint:
@golangci-lint run --timeout 5m -D structcheck,unused -E bodyclose,exhaustive,exportloopref,gosec,misspell,rowserrcheck,unconvert,unparam --out-format tab --sort-results --tests=false

.PHONY: stats
stats:
scc --exclude-dir 'vendor,node_modules,data,.git,docker/etcdkeeper,utils' --wide ./...

.PHONY: tools-install
tools-install:
cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run
Loading