source/tools/lint.sh

26 lines
618 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
2021-08-30 04:17:57 +00:00
function brl() {
bin="$1"
shift
bazel build "//${bin}"
"bazel-bin/${bin}/$(basename ${bin})" "$@"
return "$?"
}
2021-04-08 06:37:51 +00:00
2021-08-30 04:35:00 +00:00
brl tools/flake8 "${DIRS[@]}"
2021-08-30 04:17:57 +00:00
brl tools/isort --check "${DIRS[@]}"
brl tools/unify --quote '"' -cr "${DIRS[@]}"
brl tools/reqman lint tools/python/requirements.txt
2021-04-08 06:37:51 +00:00
2021-08-30 04:17:57 +00:00
# OpenAPI specific junk
2021-04-08 06:37:51 +00:00
for f in $(find . -type f -name "openapi.yaml"); do
2021-08-30 04:17:57 +00:00
brl tools/openapi "${f}" && echo "Schema $f OK"
brl tools/yamllint -c tools/yamllint/yamllintrc "${f}"
2021-04-08 06:37:51 +00:00
done