We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78eebc1 commit f26ea9cCopy full SHA for f26ea9c
docs/formatting.md
@@ -181,7 +181,12 @@ fi
181
# Get staged files and format them
182
git diff --cached --diff-filter=AM --name-only -z | xargs --null --no-run-if-empty bash -c '
183
if [ $# -gt 0 ]; then
184
- bazel run //:format -- "$@"
+ # Avoid building the target if it was already placed in the bazel_env output
185
+ if [ -e "bazel-out/bazel_env-opt/bin/tools/bazel_env/bin/format" ]; then
186
+ bazel-out/bazel_env-opt/bin/tools/bazel_env/bin/format "$@"
187
+ else
188
+ bazel run //:format -- "$@"
189
+ fi
190
191
if ! git diff --quiet -- "$@"; then
192
echo "❌ Some staged files were modified by the pre-commit hook."
0 commit comments