Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab8e585

Browse files
committedNov 22, 2019
ci: rust checkfmt
1 parent 8356057 commit ab8e585

File tree

5 files changed

+22187
-19625
lines changed

5 files changed

+22187
-19625
lines changed
 

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ generate: $(GENERATED_TARGETS)
5050
ast/internal/fbast: ast/ast.fbs
5151
$(GO_GENERATE) ./ast
5252
libflux/src/ast/flatbuffers/ast_generated.rs: ast/ast.fbs
53-
flatc --rust -o libflux/src/ast/flatbuffers ast/ast.fbs
53+
flatc --rust -o libflux/src/ast/flatbuffers ast/ast.fbs && rustfmt $@
5454

5555
semantic/internal/fbsemantic: semantic/semantic.fbs
5656
$(GO_GENERATE) ./semantic
5757
libflux/src/semantic/flatbuffers/semantic_generated.rs: semantic/semantic.fbs
58-
flatc --rust -o libflux/src/semantic/flatbuffers semantic/semantic.fbs
58+
flatc --rust -o libflux/src/semantic/flatbuffers semantic/semantic.fbs && rustfmt $@
5959

6060
# Force a second expansion to happen so the call to go_deps works correctly.
6161
.SECONDEXPANSION:

‎etc/checkfmt.sh

+10
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ if [ "$HAS_FMT_ERR" -eq "1" ]; then
2626
echo 'run "make fmt"' && \
2727
echo ''
2828
fi
29+
30+
cd libflux
31+
FMT_OUT="$(cargo fmt --all -- --check)"
32+
if [[ -n "$FMT_OUT" ]]; then
33+
echo 'Commit includes files that are not rustfmt-ed' && \
34+
echo 'run "make fmt"' && \
35+
echo ''
36+
HAS_FMT_ERR=1
37+
fi
38+
2939
exit "$HAS_FMT_ERR"

‎libflux/rustfmt.toml

Whitespace-only changes.

‎libflux/src/ast/flatbuffers/ast_generated.rs

+11,885-10,591
Large diffs are not rendered by default.

‎libflux/src/semantic/flatbuffers/semantic_generated.rs

+10,290-9,032
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.