chore: update and relax revive naming rules (#38615)

- enable `skip-initialism-name-checks`, so names like `sessionUid` are
allowed
- replace removed `skip-package-name-checks` option with new
`package-naming` with fitting rules for gitea
- drop dead exclusion paths
This commit is contained in:
silverwind
2026-07-24 21:47:23 +00:00
committed by GitHub
parent 818da42728
commit 13406e7aa7
4 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -9,11 +9,11 @@ import (
"gitea.dev/modules/json"
)
type JsonUtils struct{} //nolint:revive // variable naming triggers on Json, wants JSON
type JsonUtils struct{}
var jsonUtils = JsonUtils{}
func NewJsonUtils() *JsonUtils { //nolint:revive // variable naming triggers on Json, wants JSON
func NewJsonUtils() *JsonUtils {
return &jsonUtils
}
+1 -1
View File
@@ -186,7 +186,7 @@ func reactionToEmoji(reaction string) template.HTML {
return template.HTML(fmt.Sprintf(`<img alt=":%s:" src="%s/assets/img/emoji/%s.png"></img>`, reaction, setting.StaticURLPrefix, url.PathEscape(reaction)))
}
func (ut *RenderUtils) MarkdownToHtml(input string) template.HTML { //nolint:revive // variable naming triggers on Html, wants HTML
func (ut *RenderUtils) MarkdownToHtml(input string) template.HTML {
output, err := markdown.RenderString(markup.NewRenderContext(ut.ctx).WithMetas(markup.ComposeSimpleDocumentMetas()), input)
if err != nil {
log.Error("RenderString: %v", err)
+1 -1
View File
@@ -120,7 +120,7 @@ func asciiLower(b byte) byte {
// AsciiEqualFold is from Golang https://cs.opensource.google/go/go/+/refs/tags/go1.24.4:src/net/http/internal/ascii/print.go
// ASCII only. In most cases for protocols, we should only use this but not [strings.EqualFold]
func AsciiEqualFold(s, t string) bool { //nolint:revive // PascalCase
func AsciiEqualFold(s, t string) bool {
if len(s) != len(t) {
return false
}