aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-06-11 19:16:43 +0000
committerIsis Lovecruft <isis@torproject.org>2018-06-11 19:16:56 +0000
commit5f3a4e14e361c073797d89d5475ef34d7737bd23 (patch)
treee42c7062ed7e0e6bd246f8d47a2e99fb844eb1b1 /Makefile.am
parentf399887cfec8ddaf33cac06b2abad25a3d42aac9 (diff)
downloadtor-5f3a4e14e361c073797d89d5475ef34d7737bd23.tar.gz
tor-5f3a4e14e361c073797d89d5475ef34d7737bd23.zip
build: Add `make clippy` option for Rust linting.
Note that clippy is quite loud/obnoxious, as its name would imply. This target isn't meant to run on CI, or even necessarily exit cleanly. It's merely a way for developers to check if they've made any glaring mistakes, or done awkward things they might not have otherwise realised. We *can* configure it to be quieter in the future, but it's probably not worth rabbitholing on. * CLOSES #22156: https://bugs.torproject.org/22156
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 58ff9fb3e8..c533f577b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -238,6 +238,20 @@ check-typos:
echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
fi
+.PHONY: clippy
+clippy:
+if USE_RUST
+ @if test -x "`which cargo-clippy 2>&1;true`"; then \
+ echo "Running cargo clippy ..."; \
+ echo "Prepare yourself for the onslaught of suggestions ..."; \
+ (cd "$(top_srcdir)/src/rust" && cargo clippy); \
+ else \
+ echo "Tor can use clippy to lint Rust code."; \
+ echo "However, it seems that you don't have clippy installed."; \
+ echo "You can install the latest version of clippy by following the directions here: https://github.com/rust-lang-nursery/rust-clippy"; \
+ fi
+endif
+
.PHONY: check-changes
check-changes:
if USEPYTHON