Initial commit
This commit is contained in:
commit
7828e11046
|
|
@ -0,0 +1,43 @@
|
||||||
|
version: "2"
|
||||||
|
|
||||||
|
linters:
|
||||||
|
default: standard # errcheck, govet, staticcheck, unused, ineffassign
|
||||||
|
enable:
|
||||||
|
# --- general additions ---
|
||||||
|
- gocritic
|
||||||
|
- revive
|
||||||
|
- errorlint
|
||||||
|
- gosec
|
||||||
|
- unconvert
|
||||||
|
- misspell
|
||||||
|
# --- HTTP / API-client (Sheets + Telegram) ---
|
||||||
|
- bodyclose # unclosed response Body -> fd/conn leak
|
||||||
|
- noctx # request built without context
|
||||||
|
- errchkjson # unmarshalable types into json.Marshal
|
||||||
|
- canonicalheader # non-canonical net/http.Header keys
|
||||||
|
# --- context discipline (the real delta for this workload) ---
|
||||||
|
- contextcheck # don't drop the inherited ctx for Background/TODO
|
||||||
|
- fatcontext # nested/repeated ctx wrapping inside loops
|
||||||
|
- containedctx # ctx stored in a struct field (anti-pattern)
|
||||||
|
# --- uncomment if you persist bot state in SQL ---
|
||||||
|
# - rowserrcheck
|
||||||
|
# - sqlclosecheck
|
||||||
|
|
||||||
|
settings:
|
||||||
|
errcheck:
|
||||||
|
check-type-assertions: true
|
||||||
|
misspell:
|
||||||
|
locale: US
|
||||||
|
|
||||||
|
exclusions:
|
||||||
|
rules:
|
||||||
|
- path: _test\.go
|
||||||
|
linters:
|
||||||
|
- gosec
|
||||||
|
- errcheck
|
||||||
|
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
# - gofumpt
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
# markdownlint-cli2 configuration
|
||||||
|
# https://github.com/DavidAnson/markdownlint-cli2
|
||||||
|
|
||||||
|
globs:
|
||||||
|
- "**/*.md"
|
||||||
|
|
||||||
|
ignores:
|
||||||
|
- "vendor/**"
|
||||||
|
- "node_modules/**"
|
||||||
|
|
||||||
|
config:
|
||||||
|
# Allow long lines — documentation often has URLs and tables
|
||||||
|
MD013: false
|
||||||
|
# Allow duplicate headings in different sections
|
||||||
|
MD024:
|
||||||
|
siblings_only: true
|
||||||
|
# Allow trailing punctuation in headings
|
||||||
|
MD026:
|
||||||
|
punctuation: ".,;:!"
|
||||||
|
# Allow inline HTML when needed
|
||||||
|
MD033: false
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/DavidAnson/markdownlint-cli2
|
||||||
|
rev: v0.22.0
|
||||||
|
hooks:
|
||||||
|
- id: markdownlint-cli2
|
||||||
|
|
||||||
|
- repo: https://github.com/dnephin/pre-commit-golang
|
||||||
|
rev: v0.5.1
|
||||||
|
hooks:
|
||||||
|
- id: go-fmt
|
||||||
|
- id: golangci-lint
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-merge-conflict
|
||||||
Loading…
Reference in New Issue