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
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
day: friday
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "chore: "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
day: friday
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "chore: "
groups:
experimental-golang-deps:
patterns:
- "golang.org/x/*"
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Summary

...enter summary here...

## Notable Changes

- ...enter notable changes here...
- ...enter notable changes here...

## Change Type

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CodeQL

on:
push:
branches:
- main
pull_request:

schedule:
- cron: "00 5 * * SAT"

jobs:
codeql:
permissions:
actions: read
contents: read
security-events: write
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "^1.24.3"

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
72 changes: 72 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Validate

on:
push:
branches:
- main
pull_request:

jobs:
validate:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "^1.24.3"

- name: Init project
run: |
go mod tidy
go generate ./...

# ____ _ _
# / ___| ___ ___ _ _ _ __(_) |_ _ _
# \___ \ / _ \/ __| | | | '__| | __| | | |
# ___) | __/ (__| |_| | | | | |_| |_| |
# |____/ \___|\___|\__,_|_| |_|\__|\__, |
# |___/
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: "-no-fail -fmt sarif -out results.sarif ./..."

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

# _ _ _
# | | (_)_ __ | |_
# | | | | '_ \| __|
# | |___| | | | | |_
# |_____|_|_| |_|\__|
#
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1.6

# _____ _
# |_ _|__ ___| |_
# | |/ _ \/ __| __|
# | | __/\__ \ |_
# |_|\___||___/\__|
#
- name: Run coverage
# TODO: Add -race flag when the container becomes thread safe
run: go test ./... -coverprofile=coverage.txt -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.txt
fail_ci_if_error: false
124 changes: 124 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
version: "2"
linters:
default: none
enable:
- asciicheck
- bidichk
- bodyclose
- cyclop
- decorder
- dupl
- durationcheck
- errcheck
- errname
- errorlint
- exhaustive
- funlen
- ginkgolinter
- gocognit
- goconst
- gocritic
- gocyclo
- gomoddirectives
- gomodguard
- gosec
- govet
- ineffassign
- lll
- loggercheck
- makezero
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- reassign
- staticcheck
- tagalign
- testableexamples
- testpackage
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
settings:
cyclop:
max-complexity: 30
package-average: 10
errcheck:
check-type-assertions: true
exhaustive:
check:
- switch
- map
funlen:
lines: 100
statements: 50
ignore-comments: true
gocognit:
min-complexity: 20
govet:
disable:
- fieldalignment
enable-all: true
settings:
shadow:
strict: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- godot
source: (noinspection|TODO)
- linters:
- gocritic
source: //noinspection
- linters:
- lll
path: mocks\.go
- linters:
- bodyclose
- dupl
- funlen
- goconst
- gosec
- noctx
- wrapcheck
- exhaustive
- gocognit
- errcheck
path: _test\.go
- linters:
- staticcheck
text: SA5011
- path: (.+)\.go$
text: declaration of "(err|ctx)" shadows declaration at
- path: (.+)\.go$
text: G115
paths:
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 50
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
Loading