-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Upgrade gopls
to v0.19.0, add make fix
#34772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+24
−9
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cee4caa
Upgrade gopls to v0.19.0
silverwind 6119b25
set severity
silverwind 3824eec
drop line, run modernize
silverwind b0458bf
run modernize as part of 'make fmt'
silverwind 9991d63
update target description
silverwind 0db1de0
split out into `make fix`
silverwind 1835632
description
silverwind 73cf747
add to deps-tools
silverwind 7a7a9f3
Merge branch 'main' into gopls19
lunny bb90dc0
fix test
lunny 939c9cb
Merge branch 'main' into gopls19
GiteaBot 7f6db64
Merge branch 'main' into gopls19
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest | |
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1 | ||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 | ||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1 | ||
GOPLS_PACKAGE ?= golang.org/x/tools/[email protected] | ||
GOPLS_PACKAGE ?= golang.org/x/tools/[email protected] | ||
GOPLS_MODERNIZE_PACKAGE ?= golang.org/x/tools/gopls/internal/analysis/modernize/cmd/[email protected] | ||
|
||
DOCKER_IMAGE ?= gitea/gitea | ||
DOCKER_TAG ?= latest | ||
|
@@ -230,7 +231,7 @@ clean: ## delete backend and integration files | |
tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/ | ||
|
||
.PHONY: fmt | ||
fmt: ## format the Go code | ||
fmt: ## format the Go and template code | ||
@GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}' | ||
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl')) | ||
@# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only | ||
|
@@ -249,6 +250,19 @@ fmt-check: fmt | |
exit 1; \ | ||
fi | ||
|
||
.PHONY: fix | ||
fix: ## apply automated fixes to Go code | ||
$(GO) run $(GOPLS_MODERNIZE_PACKAGE) -fix ./... | ||
|
||
.PHONY: fix-check | ||
fix-check: fix | ||
@diff=$$(git diff --color=always $(GO_SOURCES)); \ | ||
if [ -n "$$diff" ]; then \ | ||
echo "Please run 'make fix' and commit the result:"; \ | ||
printf "%s" "$${diff}"; \ | ||
exit 1; \ | ||
fi | ||
|
||
.PHONY: $(TAGS_EVIDENCE) | ||
$(TAGS_EVIDENCE): | ||
@mkdir -p $(MAKE_EVIDENCE_DIR) | ||
|
@@ -288,7 +302,7 @@ checks: checks-frontend checks-backend ## run various consistency checks | |
checks-frontend: lockfile-check svg-check ## check frontend files | ||
|
||
.PHONY: checks-backend | ||
checks-backend: tidy-check swagger-check fmt-check swagger-validate security-check ## check backend files | ||
checks-backend: tidy-check swagger-check fmt-check fix-check swagger-validate security-check ## check backend files | ||
|
||
.PHONY: lint | ||
lint: lint-frontend lint-backend lint-spell ## lint everything | ||
|
@@ -809,6 +823,7 @@ deps-tools: ## install tool dependencies | |
$(GO) install $(GOVULNCHECK_PACKAGE) & \ | ||
$(GO) install $(ACTIONLINT_PACKAGE) & \ | ||
$(GO) install $(GOPLS_PACKAGE) & \ | ||
$(GO) install $(GOPLS_MODERNIZE_PACKAGE) & \ | ||
wait | ||
|
||
node_modules: package-lock.json | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.