Files
argo-cd/hack/format-code.sh
Jesse Suen 39174ab969 Move parameters listing from GenerateManifests to GetAppDetails (#1221)
* Move parameters listing from GenerateManifests to GetAppDetails
* Fix logging to use standard logger to honor CLI loglevel
2019-03-05 14:56:47 -08:00

20 lines
457 B
Bash
Executable File

#! /bin/sh
set -eu
CHANGED_GO_FILES=""
for file in $(git diff --name-only | grep ".go$" || true); do
if [[ -f ${file} ]] ; then
CHANGED_GO_FILES="${CHANGED_GO_FILES} ${file}"
fi
done
if [[ "${CHANGED_GO_FILES}" != "" ]]; then
echo "Formatting imports"
goimports -w -local github.com/argoproj/argo-cd ${CHANGED_GO_FILES} ;
echo "Formatting code"
gofmt -w ${CHANGED_GO_FILES} ;
else
echo "No changed files to format"
fi