Skip to content

Enable addtional linters #34085

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
merged 12 commits into from
Apr 1, 2025
Merged

Conversation

TheFox0x7
Copy link
Contributor

enable mirror, usestdlibbars and perfsprint
part of: #34083


@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 31, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/migrations modifies/internal labels Mar 31, 2025
@TheFox0x7 TheFox0x7 marked this pull request as ready for review March 31, 2025 22:22
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 1, 2025
@wxiaoguang
Copy link
Contributor

It seems that bytes.NewBufferString(payload) should be strings.NewReader

Because bytes.NewBufferString(payload) does []byte(s) internally, the same as bytes.NewBuffer([]byte(s))

@wxiaoguang
Copy link
Contributor

"Usage: "Dump output format, default to \"zip\", supported types: " + strings.Join(dump.SupportedOutputTypes, "

Seems less readable than before

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 1, 2025

	case api.HookIssueAssigned:
		operateResult = fmt.Sprintf("%s assign this to %s", p.Sender.UserName, assignList[len(assignList)-1].UserName)
	case api.HookIssueUnassigned:
		operateResult = p.Sender.UserName + " unassigned this for someone"
	case api.HookIssueMilestoned:
		operateResult = fmt.Sprintf("%s/milestone/%d", p.Repository.HTMLURL, p.Issue.Milestone.ID)

For code like this, keep using fmt.Sprintf is more consistent with above and below ......


Just keep it for this PR

@TheFox0x7
Copy link
Contributor Author

No arguments there, I'll revert the strings optimizations and see how much can I toggle off

@wxiaoguang
Copy link
Contributor

No arguments there, I'll revert the strings optimizations and see how much can I toggle off

I am working on it, just a moment.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 1, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) April 1, 2025 09:40
# Conflicts:
#	routers/web/repo/actions/badge.go
@wxiaoguang wxiaoguang merged commit ee3c82f into go-gitea:main Apr 1, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Apr 1, 2025
@TheFox0x7 TheFox0x7 deleted the enable-addtional-linters branch April 1, 2025 16:42
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 3, 2025
* giteaofficial/main:
  Refactor Branch struct in package modules/git (go-gitea#33980)
  Support creating relative link to raw path in markdown (go-gitea#34105)
  Add new CLI flags to set name and scopes when creating a user with access token (go-gitea#34080)
  Do not show 500 error when default branch doesn't exist (go-gitea#34096)
  Return default avatar url when user id is zero rather than updating database (go-gitea#34094)
  [skip ci] Updated translations via Crowdin
  Fix return bug (go-gitea#34093)
  Move ParseCommitWithSSHSignature to service layer (go-gitea#34087)
  fix(i18n): clarify ownership in password change error messages (go-gitea#34092)
  Enable addtional linters (go-gitea#34085)
  Add flat-square action badge style (go-gitea#34062)
  Fix some UI bugs and clean up unused tests (go-gitea#34088)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/go Pull requests that update Go code modifies/internal modifies/migrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants