chore(circleci): split pre-commit job (#4818)
This commit is contained in:
+10
-22
@@ -2,39 +2,27 @@
|
||||
# shellcheck disable=SC1091
|
||||
set -e
|
||||
|
||||
if [ -n "$CI" ]
|
||||
then
|
||||
echo "running eslint"
|
||||
yarn eslint:projectwide
|
||||
echo "...eslint done"
|
||||
echo "running prettier"
|
||||
yarn prettier:check
|
||||
echo "...prettier done"
|
||||
else
|
||||
# shellcheck disable=SC1090
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
yarn lint-staged
|
||||
fi
|
||||
|
||||
echo "🔍 looking for additional linter dependencies"
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
yarn lint-staged
|
||||
|
||||
check_dependencies_available() {
|
||||
echo "🔍 looking for additional linter dependencies"
|
||||
for i in "${@}"
|
||||
do
|
||||
if ! command -v "${i}"; then
|
||||
if ! command "${i}"; then
|
||||
echo "No ${i} executable found skipping additional checks" >&2
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "✅ All additional dependencies found"
|
||||
}
|
||||
|
||||
additional_dependencies=""
|
||||
if [ -z "${CI}" ]; then
|
||||
additional_dependencies=" ggshield"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
check_dependencies_available pre-commit hadolint helm shellcheck circleci${additional_dependencies}
|
||||
check_dependencies_available pre-commit hadolint helm shellcheck circleci ggshield
|
||||
|
||||
echo "All systems functional, running additional pre-commit checks..."
|
||||
echo "🍵 Updating JSON schema for Helm chart"
|
||||
yarn helm:jsonschema:generate
|
||||
|
||||
echo "▶️ Running pre-commit hooks"
|
||||
pre-commit run --all-files
|
||||
|
||||
Reference in New Issue
Block a user