forked from mintlayer/mintlayer-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_checks.sh
executable file
·41 lines (33 loc) · 1.27 KB
/
do_checks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
PYTHON=$(which python || which python3)
cargo fmt --check -- --config newline_style=Unix
# Install cargo deny first with: cargo install cargo-deny
cargo deny check --hide-inclusion-graph
# Checks enabled everywhere, including tests, benchmarks
cargo clippy --all-features --workspace --all-targets -- \
-D warnings \
-A clippy::unnecessary_literal_unwrap \
-A clippy::new_without_default \
-D clippy::implicit_saturating_sub \
-D clippy::implicit_clone \
-D clippy::map_unwrap_or \
-D clippy::unnested_or_patterns \
-D clippy::manual_assert \
-D clippy::unused_async \
-D clippy::mut_mut \
-D clippy::todo
# Checks that only apply to production code
cargo clippy --all-features --workspace --lib --bins --examples -- \
-A clippy::all \
-D clippy::float_arithmetic \
-D clippy::unwrap_used \
-D clippy::dbg_macro \
-D clippy::items_after_statements \
-D clippy::fallible_impl_from \
-D clippy::string_slice
# Install requirements with: pip install -r ./build-tools/codecheck/requirements.txt
"$PYTHON" "$SCRIPT_DIR/build-tools/codecheck/codecheck.py"
# Ensure that wasm documentation is up-to-date
cargo run -p wasm-doc-gen -- -o wasm-wrappers/WASM-API.md --check