Skip to content

Commit a97f488

Browse files
committed
Ignored some of the lint issues with reason
1 parent e638fda commit a97f488

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

internal/command/personalaccesstoken/personalaccesstoken.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
const (
23-
usageText = "usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days]"
23+
usageText = "Usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days]"
2424
expiresDateFormat = "2006-01-02"
2525
)
2626

@@ -63,7 +63,7 @@ func (c *Command) Execute(ctx context.Context) (context.Context, error) {
6363

6464
func (c *Command) parseTokenArgs() error {
6565
if len(c.Args.SshArgs) < 3 || len(c.Args.SshArgs) > 4 {
66-
return errors.New(usageText)
66+
return errors.New(usageText) // nolint:stylecheck // usageText is customer facing
6767
}
6868

6969
var rectfiedScopes []string

internal/command/personalaccesstoken/personalaccesstoken_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestExecute(t *testing.T) {
178178
},
179179
{
180180
desc: "With unknown configured scopes",
181-
PATConfig: config.PATConfig{AllowedScopes: []string{"unknown_repository"}},
181+
PATConfig: config.PATConfig{AllowedScopes: []string{"read_reposotory"}}, //nolint:misspell //testing purpose
182182
arguments: &commandargs.Shell{
183183
GitlabKeyId: "default",
184184
SshArgs: []string{cmdname, "newtoken", "read_api,read_repository"},
@@ -192,20 +192,20 @@ func TestExecute(t *testing.T) {
192192
PATConfig: config.PATConfig{AllowedScopes: []string{"read_api", "read_repository"}},
193193
arguments: &commandargs.Shell{
194194
GitlabKeyId: "default",
195-
SshArgs: []string{cmdname, "newtoken", "read_api,unknown_repository"},
195+
SshArgs: []string{cmdname, "newtoken", "read_api,read_reposotory"}, //nolint:misspell //testing purpose
196196
},
197197
expectedOutput: "Token: YXuxvUgCEmeePY3G1YAa\n" +
198198
"Scopes: read_api\n" +
199199
"Expires: 9001-11-17\n",
200200
},
201201
{
202202
desc: "With matching unknown requested scopes",
203-
PATConfig: config.PATConfig{AllowedScopes: []string{"read_api", "unknown_repository"}},
203+
PATConfig: config.PATConfig{AllowedScopes: []string{"read_api", "read_reposotory"}}, //nolint:misspell //testing purpose
204204
arguments: &commandargs.Shell{
205205
GitlabKeyId: "invalidscope",
206-
SshArgs: []string{cmdname, "newtoken", "unknown_repository"},
206+
SshArgs: []string{cmdname, "newtoken", "read_reposotory"}, //nolint:misspell //testing purpose
207207
},
208-
expectedError: "Invalid scope: 'unknown_repository'. Valid scopes are: [\"api\", \"create_runner\", \"k8s_proxy\", \"read_api\", \"read_registry\", \"read_repository\", \"read_user\", \"write_registry\", \"write_repository\"]",
208+
expectedError: "Invalid scope: 'read_reposotory'. Valid scopes are: [\"api\", \"create_runner\", \"k8s_proxy\", \"read_api\", \"read_registry\", \"read_repository\", \"read_user\", \"write_registry\", \"write_repository\"]",
209209
},
210210
}
211211

spec/gitlab_shell_personal_access_token_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def mock_server(server)
5353
remote:
5454
remote: ========================================================================
5555
remote:
56-
remote: usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days]
56+
remote: Usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days]
5757
remote:
5858
remote: ========================================================================
5959
remote:

support/lint_last_known_acceptable.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ internal/gitlabnet/lfstransfer/client.go:125: internal/gitlabnet/lfstransfer/cli
259259
internal/gitlabnet/lfstransfer/client.go:214:1: exported: exported method Client.Lock should have comment or be unexported (revive)
260260
internal/gitlabnet/lfstransfer/client.go:271:1: exported: exported method Client.Unlock should have comment or be unexported (revive)
261261
internal/gitlabnet/lfstransfer/client.go:321:1: exported: exported method Client.ListLocksVerify should have comment or be unexported (revive)
262-
internal/gitlabnet/personalaccesstoken/client_test.go:30:5: go-require: do not use require in http handlers (testifylint)
263262
internal/sshd/gssapi_unsupported.go:11:1: exported: exported function NewGSSAPIServer should have comment or be unexported (revive)
264263
internal/sshd/gssapi_unsupported.go:19:6: exported: exported type OSGSSAPIServer should have comment or be unexported (revive)
265264
internal/sshd/gssapi_unsupported.go:23:1: exported: exported method OSGSSAPIServer.AcceptSecContext should have comment or be unexported (revive)

0 commit comments

Comments
 (0)