mirror of
https://github.com/xlionjuan/searxng-mcp-go.git
synced 2026-11-16 19:40:03 +00:00
* chore(deps): update dependency go to v1.27.1 * Fixed all lints; just verify passes. Co-authored-by: xlionjuan <[email protected]> * Fixed `.golangci.yml` paths→path; `just verify` passes. Co-authored-by: xlionjuan <[email protected]> * Parallelized golden & error-path tests; verify passes. Co-authored-by: xlionjuan <[email protected]> * Verify passes; HTTPClient/Logger nil set; exhaustruct covers Config. Co-authored-by: xlionjuan <[email protected]> --------- Co-authored-by: xlion-bot-renovate[bot] <218815870+xlion-bot-renovate[bot]@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: xlionjuan <[email protected]>
161 lines
3.7 KiB
YAML
161 lines
3.7 KiB
YAML
version: "2"
|
|
run:
|
|
modules-download-mode: readonly
|
|
tests: true
|
|
linters:
|
|
default: all
|
|
enable:
|
|
- fatcontext
|
|
- gomodguard_v2
|
|
- nosprintfhostport
|
|
- perfsprint
|
|
- sloglint
|
|
- thelper
|
|
- usetesting
|
|
- wastedassign
|
|
disable:
|
|
- exhaustruct
|
|
- gochecknoglobals
|
|
- gomodguard
|
|
- nestif
|
|
- wrapcheck
|
|
- wsl
|
|
settings:
|
|
cyclop:
|
|
max-complexity: 15
|
|
depguard:
|
|
rules:
|
|
main:
|
|
list-mode: strict
|
|
files:
|
|
- "**/main.go"
|
|
- "**/cli.go"
|
|
- "**/mcp.go"
|
|
- "**/testhelpers.go"
|
|
allow:
|
|
- $gostd
|
|
- "github.com/modelcontextprotocol/go-sdk/mcp"
|
|
- "searxng-mcp-go/internal/searxng"
|
|
deny:
|
|
- pkg: "net/http"
|
|
desc: "Use internal client wrapper instead"
|
|
dupl:
|
|
threshold: 100
|
|
errcheck:
|
|
check-type-assertions: true
|
|
check-blank: true
|
|
exclude-functions:
|
|
- errors.AsType
|
|
errorlint:
|
|
asserts: true
|
|
comparison: true
|
|
exhaustruct_v5:
|
|
optional-patterns:
|
|
- ".*/http\\.(Client|Transport)$"
|
|
- ".*net\\.Dialer$"
|
|
- "searxng-mcp-go/internal/searxng\\.(ParamDef|SearXNGSearcher|attemptResult|SearchArgs|searchResponseJSON)$"
|
|
- ".*/mcp\\.(Tool|ToolAnnotations|Implementation|CallToolResult|TextContent)$"
|
|
gocognit:
|
|
min-complexity: 20
|
|
goconst:
|
|
min-len: 2
|
|
min-occurrences: 2
|
|
gocritic:
|
|
enabled-checks:
|
|
- deferInLoop
|
|
- httpNoBody
|
|
- unnecessaryDefer
|
|
gocyclo:
|
|
min-complexity: 13
|
|
govet:
|
|
enable:
|
|
- shadow
|
|
interfacebloat:
|
|
max: 5
|
|
lll:
|
|
line-length: 120
|
|
misspell:
|
|
locale: US
|
|
nakedret:
|
|
max-func-lines: 1
|
|
funlen:
|
|
lines: 60
|
|
statements: 40
|
|
prealloc:
|
|
simple: true
|
|
range-loops: true
|
|
sloglint:
|
|
no-mixed-args: true
|
|
kv-only: true
|
|
varnamelen:
|
|
min-name-length: 2
|
|
nolintlint:
|
|
require-specific: true
|
|
require-explanation: true
|
|
exclusions:
|
|
generated: lax
|
|
paths:
|
|
- .*\.pb\.go$
|
|
- third_party$
|
|
- builtin$
|
|
- examples$
|
|
rules:
|
|
- linters: [exhaustruct_v5]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [forbidigo]
|
|
path: "cli\\.go$"
|
|
text: ".*"
|
|
- linters: [funlen]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [dupl]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [gosmopolitan]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [tagliatelle]
|
|
path: "internal/searxng/(types|answer/typed)\\.go$"
|
|
text: "json\\(camel\\): got '(time_range|feels_like|wind_from|wind_speed|cloud_cover|country_code|number_of_results|unresponsive_engines)'"
|
|
- linters: [paralleltest]
|
|
path: "e2e_.*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [revive]
|
|
path: "internal/searxng/(errors|searcher)\\.go$"
|
|
text: "exported: type name will be used as searxng\\.(SearXNGError|SearXNGSearcher)"
|
|
- linters: [goconst]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
- linters: [varnamelen]
|
|
path: ".*_test\\.go$"
|
|
text: ".*"
|
|
|
|
issues:
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0
|
|
formatters:
|
|
enable:
|
|
- gci
|
|
- gofmt
|
|
- gofumpt
|
|
- goimports
|
|
settings:
|
|
gci:
|
|
sections:
|
|
- standard
|
|
- default
|
|
- prefix(searxng-mcp-go)
|
|
gofumpt:
|
|
module-path: searxng-mcp-go
|
|
extra:
|
|
group-params: true
|
|
clothe-returns: true
|
|
balance-calls: true
|
|
exclusions:
|
|
generated: lax
|
|
paths:
|
|
- .*\.pb\.go$
|
|
- third_party$
|
|
- builtin$
|
|
- examples$
|