Skip to content
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

feat: Add autodiscover mode #2

Merged
merged 11 commits into from
Nov 2, 2023

fix: Small fixes to docs/indent/tests

2375166
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: Add autodiscover mode #2

fix: Small fixes to docs/indent/tests
2375166
Select commit
Loading
Failed to load commit list.
GitHub Actions / golangci-lint failed Nov 2, 2023 in 0s

reviewdog [golangci-lint] report

reported by reviewdog 🐶

Findings (9)

server/core/config/raw/global_cfg.go|216 col 20| var-declaration: should omit type *AutoDiscover from declaration of var autoDiscover; it will be inferred from the right-hand side (revive)
server/core/config/raw/global_cfg.go|328 col 41| var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
server/core/config/raw/repo_cfg.go|75 col 41| var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
server/core/config/raw/autodiscover_test.go|13 col 2| var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
server/core/config/raw/autodiscover_test.go|48 col 2| var-naming: don't use underscores in Go names; var auto_discover_auto should be autoDiscoverAuto (revive)
server/core/config/raw/autodiscover_test.go|49 col 2| var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
server/core/config/raw/autodiscover_test.go|50 col 2| var-naming: don't use underscores in Go names; var auto_discover_disabled should be autoDiscoverDisabled (revive)
server/core/config/raw/autodiscover_test.go|51 col 2| var-naming: don't use underscores in Go names; var random_string should be randomString (revive)
server/core/config/raw/autodiscover_test.go|103 col 2| var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)

Filtered Findings (49)

server/events/vcs/gitlab_client_test.go|445 col 33| Error return value of (*encoding/json.Encoder).Encode is not checked (errcheck)
server/events/vcs/gitlab_client_test.go|557 col 36| Error return value of (*encoding/json.Decoder).Decode is not checked (errcheck)
server/core/config/raw/step.go|40| File is not gofmt-ed with -s (gofmt)
server/events/markdown_renderer_test.go|567| File is not gofmt-ed with -s (gofmt)
server/events/vcs/azuredevops_client_test.go|621 col 13| G601: Implicit memory aliasing in for loop. (gosec)
server/events/vcs/azuredevops_client_test.go|622 col 13| G601: Implicit memory aliasing in for loop. (gosec)
server/events/event_parser_test.go|256 col 19| G601: Implicit memory aliasing in for loop. (gosec)
server/core/runtime/common/common_test.go|9 col 2| dot-imports: should not use dot imports (revive)
server/utils/spellcheck_test.go|8 col 2| dot-imports: should not use dot imports (revive)
server/events/vcs/common/common_test.go|21 col 2| dot-imports: should not use dot imports (revive)
server/events/webhooks/slack.go|46 col 29| unused-parameter: parameter 'log' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|88 col 79| unused-parameter: parameter 'command' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|109 col 42| unused-parameter: parameter 'repo' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|141 col 77| unused-parameter: parameter 'vcsstatusname' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|210 col 53| unused-parameter: parameter 'pullOptions' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|237 col 33| unused-parameter: parameter 'repo' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|266 col 38| unused-parameter: parameter 'repo' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|277 col 33| unused-parameter: parameter 'pull' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketcloud/client.go|281 col 30| unused-parameter: parameter 'VCSHostType' seems to be unused, consider removing or renaming it as _ (revive)
server/core/redis/redis.go|85 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
server/core/redis/redis.go|106 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
server/core/redis/redis.go|147 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
server/core/redis/redis.go|59 col 42| unused-parameter: parameter 'bucket' seems to be unused, consider removing or renaming it as _ (revive)
server/core/locking/locking.go|169 col 66| unused-parameter: parameter 'pull' seems to be unused, consider removing or renaming it as _ (revive)
server/core/locking/locking.go|177 col 29| unused-parameter: parameter 'key' seems to be unused, consider removing or renaming it as _ (revive)
server/core/locking/locking.go|189 col 35| unused-parameter: parameter 'repoFullName' seems to be unused, consider removing or renaming it as _ (revive)
server/core/locking/locking.go|197 col 30| unused-parameter: parameter 'key' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|270 col 41| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|273 col 53| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|276 col 45| unused-parameter: parameter 'jobID' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|277 col 47| unused-parameter: parameter 'jobID' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|282 col 44| unused-parameter: parameter 'pullInfo' seems to be unused, consider removing or renaming it as _ (revive)
server/jobs/project_command_output_handler.go|285 col 48| unused-parameter: parameter 'key' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketserver/client.go|136 col 79| unused-parameter: parameter 'command' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketserver/client.go|205 col 77| unused-parameter: parameter 'vcsstatusname' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketserver/client.go|361 col 33| unused-parameter: parameter 'pull' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/bitbucketserver/client.go|365 col 30| unused-parameter: parameter 'VCSHostType' seems to be unused, consider removing or renaming it as _ (revive)
server/core/db/boltdb_test.go|289 col 2| redefines-builtin-id: redefinition of the built-in function new (revive)
server/core/db/boltdb_test.go|386 col 2| redefines-builtin-id: redefinition of the built-in function new (revive)
server/jobs/project_command_output_handler_test.go|194 col 4| empty-block: this block is empty, you can remove it (revive)
server/jobs/project_command_output_handler_test.go|228 col 4| empty-block: this block is empty, you can remove it (revive)
server/jobs/project_command_output_handler_test.go|243 col 4| empty-block: this block is empty, you can remove it (revive)
server/core/runtime/version_step_runner.go|17 col 61| unused-parameter: parameter 'extraArgs' seems to be unused, consider removing or renaming it as _ (revive)
server/core/runtime/runtime.go|67 col 53| unused-parameter: parameter 'extraArgs' seems to be unused, consider removing or renaming it as _ (revive)
server/core/runtime/show_step_runner.go|30 col 58| unused-parameter: parameter 'extraArgs' seems to be unused, consider removing or renaming it as _ (revive)
server/core/redis/redis_test.go|325 col 2| redefines-builtin-id: redefinition of the built-in function new (revive)
server/core/runtime/apply_step_runner_test.go|364 col 43| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
server/events/vcs/gitlab_client_test.go|335 col 3| var-naming: struct field mrId should be mrID (revive)
server/events/vcs/gitlab_client.go|332 col 11| SA1019: mr.MergeStatus is deprecated: This parameter is replaced by DetailedMergeStatus in GitLab 15.6. (staticcheck)

Annotations

Check failure on line 216 in server/core/config/raw/global_cfg.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/global_cfg.go#L216

var-declaration: should omit type *AutoDiscover from declaration of var autoDiscover; it will be inferred from the right-hand side (revive)
Raw output
server/core/config/raw/global_cfg.go:216:20: var-declaration: should omit type *AutoDiscover from declaration of var autoDiscover; it will be inferred from the right-hand side (revive)
		var autoDiscover *AutoDiscover = value.(*AutoDiscover)
		                 ^

Check failure on line 328 in server/core/config/raw/global_cfg.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/global_cfg.go#L328

var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
Raw output
server/core/config/raw/global_cfg.go:328:41: var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
	var autoDiscover *valid.AutoDiscover = nil
	                                       ^

Check failure on line 75 in server/core/config/raw/repo_cfg.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/repo_cfg.go#L75

var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
Raw output
server/core/config/raw/repo_cfg.go:75:41: var-declaration: should drop = nil from declaration of var autoDiscover; it is the zero value (revive)
	var autoDiscover *valid.AutoDiscover = nil
	                                       ^

Check failure on line 13 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L13

var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
Raw output
server/core/config/raw/autodiscover_test.go:13:2: var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
	auto_discover_enabled := valid.AutoDiscoverEnabledMode
	^

Check failure on line 48 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L48

var-naming: don't use underscores in Go names; var auto_discover_auto should be autoDiscoverAuto (revive)
Raw output
server/core/config/raw/autodiscover_test.go:48:2: var-naming: don't use underscores in Go names; var auto_discover_auto should be autoDiscoverAuto (revive)
	auto_discover_auto := valid.AutoDiscoverAutoMode
	^

Check failure on line 49 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L49

var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
Raw output
server/core/config/raw/autodiscover_test.go:49:2: var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
	auto_discover_enabled := valid.AutoDiscoverEnabledMode
	^

Check failure on line 50 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L50

var-naming: don't use underscores in Go names; var auto_discover_disabled should be autoDiscoverDisabled (revive)
Raw output
server/core/config/raw/autodiscover_test.go:50:2: var-naming: don't use underscores in Go names; var auto_discover_disabled should be autoDiscoverDisabled (revive)
	auto_discover_disabled := valid.AutoDiscoverDisabledMode
	^

Check failure on line 51 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L51

var-naming: don't use underscores in Go names; var random_string should be randomString (revive)
Raw output
server/core/config/raw/autodiscover_test.go:51:2: var-naming: don't use underscores in Go names; var random_string should be randomString (revive)
	random_string := valid.AutoDiscoverMode("random_string")
	^

Check failure on line 103 in server/core/config/raw/autodiscover_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci-lint

[golangci-lint] server/core/config/raw/autodiscover_test.go#L103

var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
Raw output
server/core/config/raw/autodiscover_test.go:103:2: var-naming: don't use underscores in Go names; var auto_discover_enabled should be autoDiscoverEnabled (revive)
	auto_discover_enabled := valid.AutoDiscoverEnabledMode
	^