More breaking out
This commit is contained in:
parent
9211668d9e
commit
789573a72a
6 changed files with 34 additions and 28 deletions
18
tools/fmt.sh
18
tools/fmt.sh
|
@ -2,11 +2,19 @@
|
||||||
set -euox pipefail
|
set -euox pipefail
|
||||||
cd "$(git rev-parse --show-toplevel)"
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
bazel build //tools/python/... //projects/reqman
|
bazel build //tools/... //projects/reqman
|
||||||
|
|
||||||
DIRS=(projects tools)
|
DIRS=(projects tools)
|
||||||
|
|
||||||
bazel-bin/tools/python/autoflake -ir "${DIRS[@]}"
|
function brl() {
|
||||||
bazel-bin/tools/python/isort "${DIRS[@]}"
|
bin="$1"
|
||||||
bazel-bin/tools/python/unify --quote '"' -ir "${DIRS[@]}"
|
shift
|
||||||
bazel-bin/projects/reqman/reqman clean tools/python/requirements.txt
|
bazel build "//${bin}"
|
||||||
|
"bazel-bin/${bin}/$(basename ${bin})" "$@"
|
||||||
|
return "$?"
|
||||||
|
}
|
||||||
|
|
||||||
|
brl tools/autoflake -ir "${DIRS[@]}"
|
||||||
|
brl tools/isort "${DIRS[@]}"
|
||||||
|
brl tools/unify --quote '"' -ir "${DIRS[@]}"
|
||||||
|
brl projects/reqman clean tools/python/requirements.txt
|
||||||
|
|
|
@ -5,15 +5,21 @@ bazel build //tools/python/...
|
||||||
|
|
||||||
DIRS=(tools projects)
|
DIRS=(tools projects)
|
||||||
|
|
||||||
bazel-bin/tools/python/autoflake -r "${DIRS[@]}"
|
function brl() {
|
||||||
bazel-bin/tools/python/isort --check "${DIRS[@]}"
|
bin="$1"
|
||||||
bazel-bin/tools/python/unify --quote '"' -cr "${DIRS[@]}"
|
shift
|
||||||
bazel-bin/projects/reqman/reqman lint tools/python/requirements.txt
|
bazel build "//${bin}"
|
||||||
|
"bazel-bin/${bin}/$(basename ${bin})" "$@"
|
||||||
|
return "$?"
|
||||||
|
}
|
||||||
|
|
||||||
for f in $(find . -type f -name "openapi.yaml"); do
|
brl tools/autoflake -r "${DIRS[@]}"
|
||||||
bazel-bin/tools/python/openapi "${f}" && echo "Schema $f OK"
|
brl tools/isort --check "${DIRS[@]}"
|
||||||
done
|
brl tools/unify --quote '"' -cr "${DIRS[@]}"
|
||||||
|
brl tools/reqman lint tools/python/requirements.txt
|
||||||
|
|
||||||
|
# OpenAPI specific junk
|
||||||
for f in $(find . -type f -name "openapi.yaml"); do
|
for f in $(find . -type f -name "openapi.yaml"); do
|
||||||
bazel-bin/tools/python/yamllint -c tools/yamllint/yamllintrc "${f}"
|
brl tools/openapi "${f}" && echo "Schema $f OK"
|
||||||
|
brl tools/yamllint -c tools/yamllint/yamllintrc "${f}"
|
||||||
done
|
done
|
||||||
|
|
7
tools/openapi/BUILD
Normal file
7
tools/openapi/BUILD
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
py_binary(
|
||||||
|
name = "openapi",
|
||||||
|
main = "__main__.py",
|
||||||
|
deps = [
|
||||||
|
py_requirement("openapi-spec-validator"),
|
||||||
|
]
|
||||||
|
)
|
|
@ -1,5 +1,3 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
"""Shim for executing the openapi spec validator."""
|
"""Shim for executing the openapi spec validator."""
|
||||||
|
|
||||||
import re
|
import re
|
|
@ -45,11 +45,3 @@ py_pytest(
|
||||||
py_requirement("requirements-parser"),
|
py_requirement("requirements-parser"),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
py_binary(
|
|
||||||
name = "openapi",
|
|
||||||
main = "openapi_shim.py",
|
|
||||||
deps = [
|
|
||||||
py_requirement("openapi-spec-validator"),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ attrs==20.3.0
|
||||||
autoflake==1.4
|
autoflake==1.4
|
||||||
Babel==2.9.0
|
Babel==2.9.0
|
||||||
beautifulsoup4==4.9.3
|
beautifulsoup4==4.9.3
|
||||||
bleach==4.0.0
|
|
||||||
certifi==2020.12.5
|
certifi==2020.12.5
|
||||||
chardet==4.0.0
|
chardet==4.0.0
|
||||||
click==7.1.2
|
click==7.1.2
|
||||||
|
@ -40,7 +39,6 @@ openapi-spec-validator==0.3.0
|
||||||
packaging==20.9
|
packaging==20.9
|
||||||
parso==0.8.2
|
parso==0.8.2
|
||||||
pathspec==0.8.1
|
pathspec==0.8.1
|
||||||
pep517==0.11.0
|
|
||||||
pip-tools==6.2.0
|
pip-tools==6.2.0
|
||||||
pluggy==0.13.1
|
pluggy==0.13.1
|
||||||
port-for==0.6.1
|
port-for==0.6.1
|
||||||
|
@ -80,7 +78,6 @@ sphinxcontrib-programoutput==0.17
|
||||||
sphinxcontrib-qthelp==1.0.3
|
sphinxcontrib-qthelp==1.0.3
|
||||||
sphinxcontrib-serializinghtml==1.1.4
|
sphinxcontrib-serializinghtml==1.1.4
|
||||||
toml==0.10.2
|
toml==0.10.2
|
||||||
tomli==1.2.1
|
|
||||||
tornado==6.1
|
tornado==6.1
|
||||||
typed-ast==1.4.2
|
typed-ast==1.4.2
|
||||||
typing-extensions==3.7.4.3
|
typing-extensions==3.7.4.3
|
||||||
|
@ -89,9 +86,7 @@ untokenize==0.1.1
|
||||||
urllib3==1.26.4
|
urllib3==1.26.4
|
||||||
urwid==2.1.2
|
urwid==2.1.2
|
||||||
wcwidth==0.2.5
|
wcwidth==0.2.5
|
||||||
webencodings==0.5.1
|
|
||||||
Werkzeug==2.0.1
|
Werkzeug==2.0.1
|
||||||
yamllint==1.26.1
|
yamllint==1.26.1
|
||||||
yarl==1.6.3
|
yarl==1.6.3
|
||||||
yaspin==1.5.0
|
yaspin==1.5.0
|
||||||
zipp==3.5.0
|
|
||||||
|
|
Loading…
Reference in a new issue