-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile and shellcheck linters, refactor golangci-lint and hac…
…k dir (#45)
- Loading branch information
Showing
22 changed files
with
290 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,33 @@ | ||
issues: | ||
exclude: | ||
# Check this issue for more info: https://github.com/kyoh86/scopelint/issues/4 | ||
- Using the variable on range scope `tc` in function literal | ||
- Using the variable on range scope `tc` in function literal | ||
|
||
run: | ||
tests: true | ||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unused | ||
- varcheck | ||
- golint | ||
- gofmt | ||
- misspell | ||
- gochecknoinits | ||
- unparam | ||
- scopelint | ||
- gosec | ||
- goimports | ||
- whitespace | ||
- bodyclose | ||
- gocyclo | ||
|
||
fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ branches: | |
env: | ||
global: | ||
- GO111MODULE=on | ||
- RUN_ON_CI=true | ||
- INSTALL_DEPS=true | ||
|
||
script: skip | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Hack directory | ||
|
||
This package contains various scripts that are used by Codeowners Validator developers. | ||
|
||
## Purpose | ||
|
||
This directory contains tools, such as Go fmt, Go lint, and Go vet, that help to maintain the source code compliant to Go best coding practices. It also includes utility scripts that generate code, and scripts executed on CI pipelines. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# Inspired by https://liam.sh/post/makefiles-for-go-projects | ||
|
||
# standard bash error handling | ||
set -o nounset # treat unset variables as an error and exit immediately. | ||
set -o errexit # exit immediately when a command fails. | ||
set -E # needs to be set if we want the ERR trap | ||
|
||
readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
readonly ROOT_PATH=$( cd "${CURRENT_DIR}/.." && pwd ) | ||
|
||
# shellcheck source=./hack/lib/utilities.sh | ||
source "${CURRENT_DIR}/lib/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; } | ||
|
||
function main() { | ||
# This will find all files (not symlinks) with the executable bit set: | ||
# https://apple.stackexchange.com/a/116371 | ||
binariesToCompress=$(find "${ROOT_PATH}/dist" -perm +111 -type f) | ||
|
||
shout "Staring compression for: \n$binariesToCompress" | ||
|
||
command -v upx > /dev/null || { echo 'UPX binary not found, skipping compression.'; exit 1; } | ||
|
||
# I just do not like playing with xargs ¯\_(ツ)_/¯ | ||
for i in $binariesToCompress | ||
do | ||
upx --brute "$i" | ||
done | ||
} | ||
|
||
main |
File renamed without changes.
Oops, something went wrong.