mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 05:03:43 +01:00
add make check-rustfmt
This commit is contained in:
parent
ceac10fc3d
commit
32ad8e9919
31
Makefile.am
31
Makefile.am
@ -350,6 +350,37 @@ check-typos:
|
|||||||
echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
|
echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
.PHONY: rustfmt
|
||||||
|
rustfmt:
|
||||||
|
if USE_RUST
|
||||||
|
@if test -x "`which cargo-fmt 2>&1;true`"; then \
|
||||||
|
echo "Formatting Rust code ..."; \
|
||||||
|
(cd "$(top_srcdir)/src/rust" && cargo fmt --all --); \
|
||||||
|
else \
|
||||||
|
echo "Tor uses rustfmt (via cargo-fmt) to format Rust code."; \
|
||||||
|
echo "However, it seems that you don't have rustfmt installed."; \
|
||||||
|
printf "You can install rustfmt by following the directions here:"; \
|
||||||
|
echo " https://github.com/rust-lang-nursery/rustfmt"; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: check-rustfmt
|
||||||
|
check-rustfmt:
|
||||||
|
if USE_RUST
|
||||||
|
@if test -x "`which cargo-fmt 2>&1;true`"; then \
|
||||||
|
printf "Running rustfmt..."; \
|
||||||
|
(cd "$(top_srcdir)/src/rust" && cargo fmt --all -- --check && echo "done.") || \
|
||||||
|
(echo "**************** check-rustfmt failed. ****************"; \
|
||||||
|
echo " Run \`make rustfmt\` to apply the above changes."; \
|
||||||
|
exit 1); \
|
||||||
|
else \
|
||||||
|
echo "Tor uses rustfmt (via cargo-fmt) to format Rust code."; \
|
||||||
|
echo "However, it seems that you don't have rustfmt installed."; \
|
||||||
|
printf "You can install rustfmt by following the directions here:"; \
|
||||||
|
echo " https://github.com/rust-lang-nursery/rustfmt"; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: clippy
|
.PHONY: clippy
|
||||||
clippy:
|
clippy:
|
||||||
if USE_RUST
|
if USE_RUST
|
||||||
|
Loading…
Reference in New Issue
Block a user