Skip to content

Commit c88e9fb

Browse files
authored
Merge branch 'main' into optimize-access-refresh-clean
2 parents 7530aa8 + e03a68c commit c88e9fb

File tree

7 files changed

+9
-14
lines changed

7 files changed

+9
-14
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ linters:
153153
text: '(?i)exitAfterDefer:'
154154
paths:
155155
- node_modules
156+
- .venv
156157
- public
157158
- web_src
158159
- third_party$
@@ -172,6 +173,7 @@ formatters:
172173
generated: lax
173174
paths:
174175
- node_modules
176+
- .venv
175177
- public
176178
- web_src
177179
- third_party$

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ clean: ## delete backend and integration files
258258

259259
.PHONY: fmt
260260
fmt: ## format the Go and template code
261-
@GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
261+
@GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run tools/code-batch-process.go gitea-fmt -w '{file-list}'
262262
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
263263
@# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only
264264
@# whitespace before it
@@ -472,7 +472,7 @@ test\#%:
472472
coverage:
473473
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' coverage.out > coverage-bodged.out
474474
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' integration.coverage.out > integration.coverage-bodged.out
475-
$(GO) run build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all
475+
$(GO) run tools/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all
476476

477477
.PHONY: unit-test-coverage
478478
unit-test-coverage:

eslint.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default defineConfig([
4949
},
5050
linterOptions: {
5151
reportUnusedDisableDirectives: 2,
52+
reportUnusedInlineConfigs: 2,
5253
},
5354
plugins: {
5455
'@eslint-community/eslint-comments': comments,

tests/sqlite.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ENABLED = true
114114
[markup.html]
115115
ENABLED = true
116116
FILE_EXTENSIONS = .html
117-
RENDER_COMMAND = go run build/test-echo.go
117+
RENDER_COMMAND = go run tools/test-echo.go
118118
;RENDER_COMMAND = cat
119119
;IS_INPUT_FILE = true
120120
RENDER_CONTENT_MODE = sanitized

build/code-batch-process.go renamed to tools/code-batch-process.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"os/exec"
1313
"path/filepath"
1414
"regexp"
15+
"slices"
1516
"strconv"
1617
"strings"
1718

@@ -217,15 +218,6 @@ func newFileCollectorFromMainOptions(mainOptions map[string]string) (fc *fileCol
217218
return newFileCollector(fileFilter, batchSize)
218219
}
219220

220-
func containsString(a []string, s string) bool {
221-
for _, v := range a {
222-
if v == s {
223-
return true
224-
}
225-
}
226-
return false
227-
}
228-
229221
func giteaFormatGoImports(files []string, doWriteFile bool) error {
230222
for _, file := range files {
231223
if err := codeformat.FormatGoImports(file, doWriteFile); err != nil {
@@ -264,10 +256,10 @@ func main() {
264256
logVerbose("batch cmd: %s %v", subCmd, substArgs)
265257
switch subCmd {
266258
case "gitea-fmt":
267-
if containsString(subArgs, "-d") {
259+
if slices.Contains(subArgs, "-d") {
268260
log.Print("the -d option is not supported by gitea-fmt")
269261
}
270-
cmdErrors = append(cmdErrors, giteaFormatGoImports(files, containsString(subArgs, "-w")))
262+
cmdErrors = append(cmdErrors, giteaFormatGoImports(files, slices.Contains(subArgs, "-w")))
271263
cmdErrors = append(cmdErrors, passThroughCmd("gofmt", append([]string{"-w", "-r", "interface{} -> any"}, substArgs...)))
272264
cmdErrors = append(cmdErrors, passThroughCmd("go", append([]string{"run", os.Getenv("GOFUMPT_PACKAGE"), "-extra"}, substArgs...)))
273265
default:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)