mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-19 15:14:05 -05:00
chore: anchor golangci exclusion paths to directories (#39116)
Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
This commit is contained in:
@@ -165,10 +165,10 @@ linters:
|
|||||||
- gocritic
|
- gocritic
|
||||||
text: '(?i)exitAfterDefer:'
|
text: '(?i)exitAfterDefer:'
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- ^node_modules/
|
||||||
- .venv
|
- ^\.venv/
|
||||||
- public
|
- ^public/
|
||||||
- web_src
|
- ^web_src/
|
||||||
issues:
|
issues:
|
||||||
max-issues-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
@@ -190,10 +190,10 @@ formatters:
|
|||||||
exclusions:
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- ^node_modules/
|
||||||
- .venv
|
- ^\.venv/
|
||||||
- public
|
- ^public/
|
||||||
- web_src
|
- ^web_src/
|
||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func AssetsCors() func(next http.Handler) http.Handler {
|
|||||||
func FileHandlerFunc() http.HandlerFunc {
|
func FileHandlerFunc() http.HandlerFunc {
|
||||||
assetFS := AssetFS()
|
assetFS := AssetFS()
|
||||||
return func(resp http.ResponseWriter, req *http.Request) {
|
return func(resp http.ResponseWriter, req *http.Request) {
|
||||||
if req.Method != "GET" && req.Method != "HEAD" {
|
if req.Method != http.MethodGet && req.Method != http.MethodHead {
|
||||||
resp.WriteHeader(http.StatusMethodNotAllowed)
|
resp.WriteHeader(http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ package public
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
_ "embed"
|
|
||||||
|
|
||||||
"gitea.dev/modules/assetfs"
|
"gitea.dev/modules/assetfs"
|
||||||
|
|
||||||
|
_ "embed"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed bindata.dat
|
//go:embed bindata.dat
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func TestParseAcceptEncoding(t *testing.T) {
|
|||||||
|
|
||||||
for _, kase := range kases {
|
for _, kase := range kases {
|
||||||
t.Run(kase.Header, func(t *testing.T) {
|
t.Run(kase.Header, func(t *testing.T) {
|
||||||
assert.EqualValues(t, kase.Expected, parseAcceptEncoding(kase.Header))
|
assert.Equal(t, kase.Expected, parseAcceptEncoding(kase.Header))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func IsViteDevMode() bool {
|
|||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
lastCheck := viteDevModeCheck.Load()
|
lastCheck := viteDevModeCheck.Load()
|
||||||
if lastCheck != nil && time.Now().Sub(lastCheck.time) < time.Second {
|
if lastCheck != nil && now.Sub(lastCheck.time) < time.Second {
|
||||||
return lastCheck.isDev
|
return lastCheck.isDev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user