forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format code with cargo fmt (paritytech#104)
- Loading branch information
Showing
64 changed files
with
3,561 additions
and
2,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
SHELL := /bin/bash | ||
#ENABLE_FEATURES ?= default | ||
|
||
default: release | ||
|
||
.PHONY: all | ||
|
||
all: format build test | ||
|
||
pre-clippy: unset-override | ||
@rustup component add clippy-preview | ||
|
||
clippy: pre-clippy | ||
@cargo clippy --all --all-targets -- \ | ||
-A clippy::module_inception -A clippy::needless_pass_by_value \ | ||
-A clippy::cyclomatic_complexity -A clippy::unreadable_literal \ | ||
-A clippy::should_implement_trait -A clippy::verbose_bit_mask \ | ||
-A clippy::implicit_hasher -A clippy::large_enum_variant \ | ||
-A clippy::new_without_default -A clippy::new_without_default_derive \ | ||
-A clippy::neg_cmp_op_on_partial_ord -A clippy::too_many_arguments \ | ||
-A clippy::excessive_precision -A clippy::collapsible_if \ | ||
-A clippy::blacklisted_name | ||
|
||
build: | ||
cargo build #--features "${ENABLE_FEATURES}" | ||
|
||
release: | ||
@cargo build --release #--features "${ENABLE_FEATURES}" | ||
|
||
test: | ||
export LOG_LEVEL=DEBUG && \ | ||
export RUST_BACKTRACE=1 && \ | ||
cargo test #--features "${ENABLE_FEATURES}" --all -- --nocapture | ||
|
||
bench: | ||
LOG_LEVEL=ERROR RUST_BACKTRACE=1 cargo bench #--features "${ENABLE_FEATURES}" --all -- --nocapture | ||
|
||
unset-override: | ||
@# unset first in case of any previous overrides | ||
@if rustup override list | grep `pwd` > /dev/null; then rustup override unset; fi | ||
|
||
pre-format: unset-override | ||
@rustup component add rustfmt-preview | ||
|
||
format: pre-format | ||
@cargo fmt --all -- --check >/dev/null || \ | ||
cargo fmt --all | ||
|
||
clean: | ||
@cargo clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.