mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:31:56 +00:00
The bulk of the logic in the sg-syntax crate is related to highlighting. Since that is generic information related to highlighting, move it to scip-syntax which will be renamed to syntax-analysis in the future. I will later move some of the webserver related logic into the syntax-highlighter crate.
31 lines
628 B
Bash
Executable File
31 lines
628 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
echo "--- gofmt"
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|
|
|
# Check if all code is gofmt'd
|
|
|
|
# IGNORE:
|
|
# vendored: Vendored code doesn't matter for gofmt
|
|
# syntax-highlighter/crates: has embedded go test files
|
|
|
|
DIFF=$(
|
|
find . \( \
|
|
-path ./vendor \
|
|
-o -path ./vendored \
|
|
-o -path ./docker-images/syntax-highlighter/crates \
|
|
\) -prune -o -name '*.go' -exec gofmt -s -w -d {} +
|
|
)
|
|
if [ -z "$DIFF" ]; then
|
|
echo "Success: gofmt check passed."
|
|
exit 0
|
|
else
|
|
echo "ERROR: gofmt check failed:"
|
|
echo -e "\`\`\`term\n$DIFF\n\`\`\`" >./annotations/gofmt
|
|
echo "^^^ +++"
|
|
exit 1
|
|
fi
|