diff --git a/scripts/addlicense b/scripts/addlicense new file mode 100755 index 00000000..d08a0ef8 --- /dev/null +++ b/scripts/addlicense @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +bazel build //vendor/github.com/google/addlicense +bin_path="bazel-bin/vendor/github.com/google/addlicense/addlicense_/addlicense" + +$bin_path \ + -c "Peridot Authors" \ + -ignore "vendor/**" \ + -ignore "third_party/**" \ + -ignore "node_modules/**" \ + -ignore ".ijwb/**" \ + -ignore ".idea/**" \ + -ignore ".vscode/**" \ + -ignore "pnpm-lock.yaml" \ + -ignore ".api-linter.yaml" \ + -v \ + . diff --git a/scripts/govendor b/scripts/govendor index 223b8efc..9eeccd31 100755 --- a/scripts/govendor +++ b/scripts/govendor @@ -11,5 +11,16 @@ for d in $(find vendor -iname build); do echo '' > $(dirname $d)/BUILD.bazel done +# run nfv2 to generate replace entries for generated content +# we don't want to invoke bazel all the time so check if it's built already +if [[ ! -f bazel-bin/devtools/nfv2/nfv2_/nfv2 ]]; then + bazel build //devtools/nfv2 +fi +# it's meant to be run with bazel but it only requires the workspace directory env +BUILD_WORKSPACE_DIRECTORY="$(pwd)" bazel-bin/devtools/nfv2/nfv2_/nfv2 + bazel run //:gazelle -bazel run //:gazelle-update-repos +# we don't care about the local repository warnings from updating the deps.bzl file +# obviously ignoring all errors is stupid, but the warnings are too noisy +# todo(mustafa): figure out a filter for the warnings +bazel run //:gazelle-update-repos 2>/dev/null diff --git a/scripts/lintproto b/scripts/lintproto new file mode 100755 index 00000000..7c7c1036 --- /dev/null +++ b/scripts/lintproto @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +bazel build //vendor/github.com/googleapis/api-linter/cmd/api-linter +bin_path="bazel-bin/vendor/github.com/googleapis/api-linter/cmd/api-linter/api-linter_/api-linter" + +$bin_path \ + $(find . -name "*.proto" ! -path "./vendor/*" ! -path "./third_party/*" ! -path "./node_modules/*" ! -path "./bazel-*") \ + -I . \ + -I third_party/googleapis \ + --config .api-linter.yaml