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

Update go wf #234

Merged
merged 9 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .github/citools/go/go-fixer-go_fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# .github/citools/go/go-fixer-go_fix
#

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning go fix\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command go fix "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
30 changes: 30 additions & 0 deletions .github/citools/go/go-lint-errcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
#
# .github/citools/go/go-lint-errcheck
#

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

main() {
printf "\nRunning Go errcheck\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command errcheck "${@}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
36 changes: 36 additions & 0 deletions .github/citools/go/go-lint-go-consistent
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# .github/citools/go/go-lint-go-consistent
#

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=(-v)
fi

main() {
printf "\nRunning Go go-consistent\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command go-consistent "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
36 changes: 36 additions & 0 deletions .github/citools/go/go-lint-go_vet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# .github/citools/go/go-lint-go_vet
#

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning Go Vet\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command go vet "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
38 changes: 38 additions & 0 deletions .github/citools/go/go-lint-gocritic
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# .github/citools/go/go-lint-gocritic
#

# go install -v github.com/go-critic/go-critic/cmd/gocritic@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=(check -enableAll)
fi

main() {
printf "\nRunning Go gocritic\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command gocritic "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
38 changes: 38 additions & 0 deletions .github/citools/go/go-lint-gocyclo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# .github/citools/go/go-lint-gocyclo
#

# go install github.com/fzipp/gocyclo/cmd/gocyclo@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning Go gocyclo\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command gocyclo "${args[@]}" .

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
38 changes: 38 additions & 0 deletions .github/citools/go/go-lint-golangci-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# .github/citools/go/go-lint-golangci-lint
#

# go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=(run --enable-all)
fi

main() {
printf "\nRunning GoLangCi-Lint\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command golangci-lint "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
38 changes: 38 additions & 0 deletions .github/citools/go/go-lint-gosec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# .github/citools/go/go-lint-gosec
#

# go install github.com/securego/gosec/cmd/gosec@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning Go GoSec\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command gosec "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
38 changes: 38 additions & 0 deletions .github/citools/go/go-lint-ineffassign
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# .github/citools/go/go-lint-ineffassign
#

# go install github.com/gordonklaus/ineffassign@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning Go ineffassign\n\n"

show_tool_versions_go

print_ruler

run_command go clean ./...

print_ruler

run_command ineffassign "${args[@]}" ./...

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
34 changes: 34 additions & 0 deletions .github/citools/go/go-lint-misspell
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
#
# .github/citools/go/go-lint-misspell
#

# go install github.com/client9/misspell/cmd/misspell@latest

# shellcheck disable=SC1091
source ../../.github/citools/includes/wrapper-library || exit

declare -i retval=0

declare -a args
args=("${@}")
if [[ ${#args[@]} -eq 0 ]]; then
args=()
fi

main() {
printf "\nRunning Go misspell\n\n"

show_tool_versions_go

print_ruler

run_command misspell "${args[@]}" .

print_ruler

echo Exit code: "${retval}"
return "${retval}"
}

time main "${@}"
Loading