Skip to content

Commit 374ea87

Browse files
Merge branch 'main' into set-default-locations-in-docker
2 parents 3d764b2 + 878c2ce commit 374ea87

File tree

767 files changed

+11538
-11594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

767 files changed

+11538
-11594
lines changed

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ rules:
368368
unicorn/no-array-push-push: [2]
369369
unicorn/no-console-spaces: [0]
370370
unicorn/no-document-cookie: [2]
371+
unicorn/no-empty-file: [2]
371372
unicorn/no-fn-reference-in-iterator: [0]
372373
unicorn/no-for-loop: [0]
373374
unicorn/no-hex-escape: [0]
@@ -404,6 +405,7 @@ rules:
404405
unicorn/prefer-date-now: [2]
405406
unicorn/prefer-default-parameters: [0]
406407
unicorn/prefer-event-key: [2]
408+
unicorn/prefer-export-from: [2]
407409
unicorn/prefer-includes: [2]
408410
unicorn/prefer-math-trunc: [2]
409411
unicorn/prefer-modern-dom-apis: [0]

.github/pull_request_template.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
<!--
2+
13
Please check the following:
24
35
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for bug fixes.
46
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md
57
3. Describe what your pull request does and which issue you're targeting (if any)
68
7-
**You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.**
9+
-->

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ linters:
99
- unused
1010
- structcheck
1111
- varcheck
12-
- golint
1312
- dupl
1413
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
1514
- gofmt
1615
- misspell
1716
- gocritic
17+
- bidichk
18+
- ineffassign
1819
enable-all: false
1920
disable-all: true
2021
fast: false
@@ -111,3 +112,6 @@ issues:
111112
linters:
112113
- staticcheck
113114
text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
115+
- path: models/user/openid.go
116+
linters:
117+
- golint

.revive.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ warningCode = 1
2323
[rule.unexported-return]
2424
[rule.indent-error-flow]
2525
[rule.errorf]
26+
[rule.duplicated-imports]

.stylelintrc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
extends: stylelint-config-standard
22

3+
overrides:
4+
- files: ["**/*.less"]
5+
customSyntax: postcss-less
6+
37
rules:
8+
alpha-value-notation: null
49
at-rule-empty-line-before: null
510
block-closing-brace-empty-line-before: null
11+
color-function-notation: null
612
color-hex-length: null
713
comment-empty-line-before: null
14+
declaration-block-no-redundant-longhand-properties: null
815
declaration-block-single-line-max-declarations: null
916
declaration-empty-line-before: null
17+
hue-degree-notation: null
1018
indentation: 2
19+
max-line-length: null
1120
no-descending-specificity: null
21+
no-invalid-position-at-import-rule: null
1222
number-leading-zero: never
23+
number-max-precision: null
24+
property-no-vendor-prefix: null
1325
rule-empty-line-before: null
26+
selector-class-pattern: null
27+
selector-id-pattern: null
1428
selector-pseudo-element-colon-notation: double
1529
shorthand-property-no-redundant-values: true
16-
no-invalid-position-at-import-rule: null
30+
string-quotes: null
31+
value-no-vendor-prefix: null

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Alexey Makhov <[email protected]> (@makhov)
2-
Andrey Nering <[email protected]> (@andreynering)
32
Bo-Yi Wu <[email protected]> (@appleboy)
43
Ethan Koenig <[email protected]> (@ethantkoenig)
54
Kees de Vries <[email protected]> (@Bwko)
@@ -45,3 +44,4 @@ Janis Estelmann <[email protected]> (@KN4CK3R)
4544
Steven Kriegler <[email protected]> (@justusbunsi)
4645
Jimmy Praet <[email protected]> (@jpraet)
4746
Leon Hofmeister <[email protected]> (@delvh)
47+
Gusted <[email protected]) (@Gusted)

Makefile

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ COMMA := ,
2727
XGO_VERSION := go-1.17.x
2828
MIN_GO_VERSION := 001016000
2929
MIN_NODE_VERSION := 012017000
30+
MIN_GOLANGCI_LINT_VERSION := 001043000
3031

3132
DOCKER_IMAGE ?= gitea/gitea
3233
DOCKER_TAG ?= latest
@@ -57,8 +58,6 @@ else
5758
SED_INPLACE := sed -i ''
5859
endif
5960

60-
GOFMT ?= gofmt -s
61-
6261
EXTRA_GOFLAGS ?=
6362

6463
MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
@@ -126,8 +125,6 @@ ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
126125
GO_SOURCES += $(BINDATA_DEST)
127126
endif
128127

129-
GO_SOURCES_OWN := $(filter-out vendor/% %/bindata.go, $(GO_SOURCES))
130-
131128
#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/swagger
132129
SWAGGER := $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
133130
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
@@ -237,7 +234,7 @@ clean:
237234
.PHONY: fmt
238235
fmt:
239236
@echo "Running go fmt..."
240-
@$(GOFMT) -w $(GO_SOURCES_OWN)
237+
@$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}'
241238

242239
.PHONY: vet
243240
vet:
@@ -297,20 +294,20 @@ misspell-check:
297294
$(GO) install github.com/client9/misspell/cmd/[email protected]; \
298295
fi
299296
@echo "Running misspell-check..."
300-
@misspell -error -i unknwon $(GO_SOURCES_OWN)
297+
@$(GO) run build/code-batch-process.go misspell -error -i unknwon '{file-list}'
301298

302299
.PHONY: misspell
303300
misspell:
304301
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
305302
$(GO) install github.com/client9/misspell/cmd/[email protected]; \
306303
fi
307304
@echo "Running go misspell..."
308-
@misspell -w -i unknwon $(GO_SOURCES_OWN)
305+
@$(GO) run build/code-batch-process.go misspell -w -i unknwon '{file-list}'
309306

310307
.PHONY: fmt-check
311308
fmt-check:
312309
# get all go files and run go fmt on them
313-
@diff=$$($(GOFMT) -d $(GO_SOURCES_OWN)); \
310+
@diff=$$($(GO) run build/code-batch-process.go gitea-fmt -s -d '{file-list}'); \
314311
if [ -n "$$diff" ]; then \
315312
echo "Please run 'make fmt' and commit the result:"; \
316313
echo "$${diff}"; \
@@ -392,7 +389,7 @@ coverage:
392389
.PHONY: unit-test-coverage
393390
unit-test-coverage:
394391
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
395-
@$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
392+
@$(GO) test $(GOTESTFLAGS) -mod=vendor -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
396393

397394
.PHONY: vendor
398395
vendor:
@@ -765,12 +762,22 @@ pr\#%: clean-all
765762
$(GO) run contrib/pr/checkout.go $*
766763

767764
.PHONY: golangci-lint
768-
golangci-lint:
765+
golangci-lint: golangci-lint-check
766+
golangci-lint run --timeout 10m
767+
768+
.PHONY: golangci-lint-check
769+
golangci-lint-check:
770+
$(eval GOLANGCI_LINT_VERSION := $(shell printf "%03d%03d%03d" $(shell golangci-lint --version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
771+
$(eval MIN_GOLANGCI_LINT_VER_FMT := $(shell printf "%g.%g.%g" $(shell echo $(MIN_GOLANGCI_LINT_VERSION) | grep -o ...)))
769772
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
773+
echo "Downloading golangci-lint v${MIN_GOLANGCI_LINT_VER_FMT}"; \
774+
export BINARY="golangci-lint"; \
775+
curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${MIN_GOLANGCI_LINT_VER_FMT}/install.sh" | sh -s -- -b $(GOPATH)/bin v$(MIN_GOLANGCI_LINT_VER_FMT); \
776+
elif [ "$(GOLANGCI_LINT_VERSION)" -lt "$(MIN_GOLANGCI_LINT_VERSION)" ]; then \
777+
echo "Downloading newer version of golangci-lint v${MIN_GOLANGCI_LINT_VER_FMT}"; \
770778
export BINARY="golangci-lint"; \
771-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.37.0; \
779+
curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${MIN_GOLANGCI_LINT_VER_FMT}/install.sh" | sh -s -- -b $(GOPATH)/bin v$(MIN_GOLANGCI_LINT_VER_FMT); \
772780
fi
773-
golangci-lint run --timeout 10m
774781

775782
.PHONY: docker
776783
docker:

0 commit comments

Comments
 (0)