-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Update golangci-lint to v2.6.0 #35801
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
Update golangci-lint to v2.6.0 #35801
Conversation
|
I think I will revert these string builder changes and disable the offending rule, it seems useless. |
|
The It says "This avoids quadratic memory allocation and improves performance." so maybe it is worth it. I will fix those var names. |
|
I manually cleaned up the stringsbuilder cases, should be ready. |
|
I really dislike unnecessary lint rules. And I have strong objection for this Sprintf change, it doesn't improve readability. |
|
I think we could disable |
|
I've disabled |
|
The previous autofixes with the ugly var names were from diff --git i/modules/git/foreachref/format.go w/modules/git/foreachref/format.go
index d9573a55d6..d2f9998fe8 100644
--- i/modules/git/foreachref/format.go
+++ w/modules/git/foreachref/format.go
@@ -74,10 +74,10 @@ func (f Format) Parser(r io.Reader) *Parser {
// hexEscaped produces hex-escpaed characters from a string. For example, "\n\0"
// would turn into "%0a%00".
func (f Format) hexEscaped(delim []byte) string {
- escaped := ""
+ var escaped strings.Builder
for i := range delim {
- escaped += "%" + hex.EncodeToString([]byte{delim[i]})
+ escaped.WriteString("%" + hex.EncodeToString([]byte{delim[i]}))
}
- return escaped
+ return escaped.String()
}Would that be an acceptable fix? |
|
I've re-enabled the modernize rule and ran |
This reverts commit f2347df.
|
Actually, I've reverted, we can discuss the merits of |
* giteaofficial/main: Remove padding override on `.ui .sha.label` (go-gitea#35864) fix(api/repo/contents): set the dates to now when not specified by the caller (go-gitea#35861) Remove `fix` Make targets (go-gitea#35868) Refactor ls-tree and git path related problems (go-gitea#35858) Fix pull description code label background (go-gitea#35865) Make ACME email optional (go-gitea#35849) Remove wrong code (go-gitea#35846) Fix Arch repo pacman.conf snippet (go-gitea#35825) Port away from `flake-utils` (go-gitea#35675) Update golangci-lint to v2.6.0 (go-gitea#35801) Add a doctor command to fix inconsistent run status (go-gitea#35840) Fix viewed files number is not right if not all files loaded (go-gitea#35821) Fix incorrect pull request counter (go-gitea#35819) Fix a number of `strictNullChecks`-related issues (go-gitea#35795) ignore .worktrees as a "special folder" (go-gitea#35835) upgrade go mail to 0.7.2 and fix the bug (go-gitea#35833)
https://github.com/golangci/golangci-lint/releases/tag/v2.6.0
modernizelinter is enabled, this is the same asgopls modernizeperfsprintlinter is disabled because it conflicts withmodernize(maybe there is a middle ground)deprecatedCommentis disabled as it conflicts withgo-swagger