Skip to content

Commit 05e2ad5

Browse files
committed
scope nolint directives for deprecated fields and functions
1 parent 3752045 commit 05e2ad5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

models/asymkey/ssh_key_parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
208208

209209
// The ssh library can parse the key, so next we find out what key exactly we have.
210210
switch pkey.Type() {
211-
case ssh.KeyAlgoDSA: //nolint
211+
case ssh.KeyAlgoDSA: //nolint:staticcheck // it's deprecated
212212
rawPub := struct {
213213
Name string
214214
P, Q, G, Y *big.Int

modules/markup/common/footnote.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (b *footnoteBlockParser) Open(parent ast.Node, reader text.Reader, pc parse
197197
return nil, parser.NoChildren
198198
}
199199
open := pos + 1
200-
closure := util.FindClosure(line[pos+1:], '[', ']', false, false) //nolint
200+
closure := util.FindClosure(line[pos+1:], '[', ']', false, false) //nolint:staticcheck // deprecated function
201201
closes := pos + 1 + closure
202202
next := closes + 1
203203
if closure > -1 {
@@ -287,7 +287,7 @@ func (s *footnoteParser) Parse(parent ast.Node, block text.Reader, pc parser.Con
287287
return nil
288288
}
289289
open := pos
290-
closure := util.FindClosure(line[pos:], '[', ']', false, false) //nolint
290+
closure := util.FindClosure(line[pos:], '[', ']', false, false) //nolint:staticcheck // deprecated function
291291
if closure < 0 {
292292
return nil
293293
}

routers/api/v1/repo/branch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ func CreateBranch(ctx *context.APIContext) {
224224
ctx.APIErrorInternal(err)
225225
return
226226
}
227-
} else if len(opt.OldBranchName) > 0 { //nolint
228-
if gitrepo.IsBranchExist(ctx, ctx.Repo.Repository, opt.OldBranchName) { //nolint
229-
oldCommit, err = ctx.Repo.GitRepo.GetBranchCommit(opt.OldBranchName) //nolint
227+
} else if len(opt.OldBranchName) > 0 { //nolint:staticcheck // deprecated field
228+
if gitrepo.IsBranchExist(ctx, ctx.Repo.Repository, opt.OldBranchName) { //nolint:staticcheck // deprecated field
229+
oldCommit, err = ctx.Repo.GitRepo.GetBranchCommit(opt.OldBranchName) //nolint:staticcheck // deprecated field
230230
if err != nil {
231231
ctx.APIErrorInternal(err)
232232
return
@@ -579,7 +579,7 @@ func CreateBranchProtection(ctx *context.APIContext) {
579579

580580
ruleName := form.RuleName
581581
if ruleName == "" {
582-
ruleName = form.BranchName //nolint
582+
ruleName = form.BranchName //nolint:staticcheck // deprecated field
583583
}
584584
if len(ruleName) == 0 {
585585
ctx.APIError(http.StatusBadRequest, "both rule_name and branch_name are empty")

0 commit comments

Comments
 (0)