1
0
Fork 0

Add code lint check

This commit is contained in:
Lauris BH 2022-07-29 02:15:46 +03:00
parent 6c871d13d1
commit 194a7d02de
No known key found for this signature in database
GPG Key ID: DFDE60A0093EB926
3 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,16 @@
pipeline:
lint:
image: golangci/golangci-lint:latest-alpine
pull: true
commands:
- golangci-lint run ./...
when:
event:
- push
- pull_request
branch:
- main
test:
image: golang:1.18
pull: true

View File

@ -112,12 +112,12 @@ Currently supports converting from Drone CI pipelines to Woodpecker CI pipeline
}
if sourcePath == "" {
fmt.Println("Error: source path is required")
cmd.Help()
_ = cmd.Help()
os.Exit(1)
}
if destPath == "" {
fmt.Println("Error: destination path is required")
cmd.Help()
_ = cmd.Help()
os.Exit(1)
}
sources, err := ReadSource(sourcePath)

View File

@ -16,7 +16,7 @@ type Secrets []Secret
func (s Secrets) MarshalYAML() (interface{}, error) {
arr := make([]interface{}, 0, len(s))
for _, secret := range s {
if secret.Target == "" || strings.ToLower(secret.Source) == strings.ToLower(secret.Target) {
if secret.Target == "" || strings.EqualFold(secret.Source, secret.Target) {
arr = append(arr, Secret{
Source: secret.Source,
Target: strings.ToLower(secret.Target),