Files
authelia/.golangci.yml
T
Amir Zarrinkafsh 306bf9d118 docs: prepare the site build for hugo 0.166.0 (#13140)
Hugo v0.166.0 drops module mounts whose root, or any directory between
it and the project root, is a symlink. The isolated pnpm linker installs
every package as a symlink into `node_modules/.pnpm`, so all of the
Thulite, Tabler, Docsearch, and bootstrap-icons mounts disappear and the
build fails with `template for shortcode "callout" not found`. Switch
`docs` to the hoisted linker so packages are real directories, and
exclude `node_modules` from golangci-lint since the hoisted layout
exposes the Go sources shipped in `flatted`.

Migrate the deprecated configuration and template usage: `languageCode`
to `locale`, `languageName` to `label`, the global `imaging.quality` and
`imaging.hint` to the per format `avif`, `jpeg`, and `webp` settings,
and `.Language.LanguageName` to `.Language.Label`. The rendered site is
byte identical to the previous configuration on both v0.165.0 and
v0.166.0 apart from processed image file names.

Add docs suite tests asserting every `node_modules` mount resolves,
since a dropped mount does not always fail the build, and that the
locale and label still drive the document language and the English
homepage sections.

Signed-off-by: Amir Zarrinkafsh <3339418+nightah@users.noreply.github.com>
2026-09-13 11:31:57 +00:00

113 lines
2.7 KiB
YAML

# SPDX-FileCopyrightText: 2026 Authelia
#
# SPDX-License-Identifier: Apache-2.0
---
version: "2"
linters:
enable:
- asciicheck
- forbidigo
- gocritic
- gocyclo
- godoclint
- godot
- gosec
- misspell
- nolintlint
- prealloc
- revive
- unconvert
- unparam
- whitespace
- wsl_v5
settings:
forbidigo:
forbid:
- pattern: ^print.*$
msg: Do not commit print statements.
- pattern: ^fmt\.Print.*$
pkg: ^fmt$
msg: Do not commit print statements.
analyze-types: true
goconst:
min-len: 2
min-occurrences: 2
ignore-tests: true
gocyclo:
min-complexity: 15
godoclint:
enable:
- no-unused-link
- require-doc
- require-pkg-doc
- require-stdlib-doclink
godot:
scope: all
exclude:
- '^\s*SPDX-'
revive:
confidence: 0.8
exclusions:
generated: lax
rules:
- linters:
- godoclint
path: _test\.go$
- linters:
- forbidigo
path: internal/commands/
- linters:
- forbidigo
path: cmd/
- path: (.+)\.go$
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked # yamllint disable-line rule:line-length
- path: (.+)\.go$
text: func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
- path: (.+)\.go$
text: (possible misuse of unsafe.Pointer|should have signature)
- path: (.+)\.go$
text: ineffective break statement. Did you mean to break out of the outer loop
- path: (.+)\.go$
text: Use of unsafe calls should be audited
- path: (.+)\.go$
text: Subprocess launch(ed with variable|ing should be audited)
- path: (.+)\.go$
text: (G104|G307)
- path: (.+)\.go$
text: (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
- path: (.+)\.go$
text: Potential file inclusion via variable
paths:
- third_party$
- builtin$
- examples$
- internal/mocks
- node_modules
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(authelia.com,github.com/authelia)
- localmodule
goimports:
local-prefixes:
- github.com/authelia/authelia
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- node_modules
...