diff --git a/mise.lock b/mise.lock index 53be2e246..6966c71ee 100644 --- a/mise.lock +++ b/mise.lock @@ -1,4 +1,4 @@ -[tools.bats] +[[tools.bats]] version = "1.12.0" backend = "aqua:bats-core/bats-core" @@ -7,10 +7,10 @@ checksum = "blake3:836a0963444ede10131984991c0f92219c84418b57c242b4ff5bc80d83daa size = 175914 url = "https://github.com/bats-core/bats-core/archive/refs/tags/v1.12.0.tar.gz" -[tools.circleci] +[[tools.circleci]] version = "0.1.32638" backend = "aqua:CircleCI-Public/circleci-cli" -[tools."npm:prettier"] +[[tools."npm:prettier"]] version = "2.8.8" backend = "npm:prettier" diff --git a/shell/fmt.sh b/shell/fmt.sh index 35381c67d..268dd9f1f 100755 --- a/shell/fmt.sh +++ b/shell/fmt.sh @@ -6,10 +6,12 @@ set -e -o pipefail DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -# shellcheck source=./lib/logging.sh -source "$DIR/lib/logging.sh" # shellcheck source=./lib/bootstrap.sh source "$DIR/lib/bootstrap.sh" +# shellcheck source=./lib/logging.sh +source "$DIR/lib/logging.sh" +# shellcheck source=./lib/mise.sh +source "$DIR/lib/mise.sh" # shellcheck source=./lib/shell.sh source "$DIR/lib/shell.sh" diff --git a/shell/linters.sh b/shell/linters.sh index ceb1420b5..4684f2fab 100755 --- a/shell/linters.sh +++ b/shell/linters.sh @@ -5,10 +5,12 @@ set -e -o pipefail DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -# shellcheck source=./lib/logging.sh -source "$DIR/lib/logging.sh" # shellcheck source=./lib/bootstrap.sh source "$DIR/lib/bootstrap.sh" +# shellcheck source=./lib/logging.sh +source "$DIR/lib/logging.sh" +# shellcheck source=./lib/mise.sh +source "$DIR/lib/mise.sh" # shellcheck source=./lib/shell.sh source "$DIR/lib/shell.sh" diff --git a/shell/linters/protobuf.sh b/shell/linters/protobuf.sh index 18269be88..9a1d00aef 100644 --- a/shell/linters/protobuf.sh +++ b/shell/linters/protobuf.sh @@ -5,18 +5,19 @@ # shellcheck disable=SC2034 extensions=(proto) +# Runs buf [...] on all versioned .proto files. +run_buf() { + local mise_bin + mise_bin="$(find_mise)" + find_files_with_extensions "${extensions[@]}" | xargs -n1 "$mise_bin" exec buf@"$(get_tool_version buf)" -- buf "$@" +} + buf_linter() { - # Why: We're OK with this. - # shellcheck disable=SC2155 - local PROTOFMT=$("$DIR/gobin.sh" -p github.com/bufbuild/buf/cmd/buf@v"$(get_tool_version "buf")") - find_files_with_extensions "${extensions[@]}" | xargs -n1 "$PROTOFMT" format --exit-code --diff + run_buf format --exit-code --diff } buf_formatter() { - # Why: We're OK with this. - # shellcheck disable=SC2155 - local PROTOFMT=$("$DIR/gobin.sh" -p github.com/bufbuild/buf/cmd/buf@v"$(get_tool_version "buf")") - find_files_with_extensions "${extensions[@]}" | xargs -n1 "$PROTOFMT" format -w + run_buf format --write } linter() {