source/tools/lint.sh

20 lines
606 B
Bash
Raw Normal View History

2021-04-08 06:37:51 +00:00
#!/usr/bin/env bash
set -euox pipefail
cd "$(git rev-parse --show-toplevel)"
bazel build //tools/python/...
DIRS=(tools projects)
2021-04-08 06:37:51 +00:00
bazel-bin/tools/python/autoflake -r "${DIRS[@]}"
bazel-bin/tools/python/isort --check "${DIRS[@]}"
bazel-bin/tools/python/unify --quote '"' -cr "${DIRS[@]}"
bazel-bin/projects/reqman/reqman lint tools/python/requirements.txt
2021-04-08 06:37:51 +00:00
for f in $(find . -type f -name "openapi.yaml"); do
bazel-bin/tools/python/openapi "${f}" && echo "Schema $f OK"
done
for f in $(find . -type f -name "openapi.yaml"); do
bazel-bin/tools/python/yamllint -c tools/yamllint/yamllintrc "${f}"
done