summaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-06-05 03:22:38 +0200
committerEarl Warren <contact@earl-warren.org>2024-06-09 11:13:39 +0200
commit6582f0029bb71adeee76a7c25d5547be77a624ff (patch)
tree8c9c3a9e8d0cb97649b3d6d848c6d8cef0434877 /services/repository
parentRemove .segment from .project-column (#31204) (diff)
downloadforgejo-6582f0029bb71adeee76a7c25d5547be77a624ff.tar.xz
forgejo-6582f0029bb71adeee76a7c25d5547be77a624ff.zip
Add `lint-go-gopls` (#30729)
Uses `gopls check <files>` as a linter. Tested locally and brings up 149 errors currently for me. I don't think I want to fix them in this PR, but I would like at least to get this analysis running on CI. List of errors: ``` modules/indexer/code/indexer.go:181:11: impossible condition: nil != nil routers/private/hook_post_receive.go:120:15: tautological condition: nil == nil services/auth/source/oauth2/providers.go:185:9: tautological condition: nil == nil services/convert/issue.go:216:11: tautological condition: non-nil != nil tests/integration/git_test.go:332:9: impossible condition: nil != nil services/migrations/migrate.go:179:24-43: unused parameter: ctx services/repository/transfer.go:288:48-69: unused parameter: doer tests/integration/api_repo_tags_test.go:75:41-61: unused parameter: session tests/integration/git_test.go:696:64-74: unused parameter: baseBranch tests/integration/gpg_git_test.go:265:27-39: unused parameter: t tests/integration/gpg_git_test.go:284:23-29: unused parameter: tmpDir tests/integration/gpg_git_test.go:284:31-35: unused parameter: name tests/integration/gpg_git_test.go:284:37-42: unused parameter: email ``` (cherry picked from commit 816222243af523316041692622be6f48ef068693) Conflicts: Makefile trivial context conflict and also ask renovate to watch over it do not include it in lint-backend because the errors are not fixed
Diffstat (limited to 'services/repository')
-rw-r--r--services/repository/transfer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/repository/transfer.go b/services/repository/transfer.go
index ca6ea6b632..467c85ef6f 100644
--- a/services/repository/transfer.go
+++ b/services/repository/transfer.go
@@ -285,7 +285,7 @@ func transferOwnership(ctx context.Context, doer *user_model.User, newOwnerName
}
// changeRepositoryName changes all corresponding setting from old repository name to new one.
-func changeRepositoryName(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, newRepoName string) (err error) {
+func changeRepositoryName(ctx context.Context, repo *repo_model.Repository, newRepoName string) (err error) {
oldRepoName := repo.Name
newRepoName = strings.ToLower(newRepoName)
if err = repo_model.IsUsableRepoName(newRepoName); err != nil {
@@ -347,7 +347,7 @@ func ChangeRepositoryName(ctx context.Context, doer *user_model.User, repo *repo
// local copy's origin accordingly.
repoWorkingPool.CheckIn(fmt.Sprint(repo.ID))
- if err := changeRepositoryName(ctx, doer, repo, newRepoName); err != nil {
+ if err := changeRepositoryName(ctx, repo, newRepoName); err != nil {
repoWorkingPool.CheckOut(fmt.Sprint(repo.ID))
return err
}