Skip to content

Commit 5237665

Browse files
committed
Run clippy on all targets
1 parent 1f43164 commit 5237665

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

.circleci/config.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -697,35 +697,35 @@ jobs:
697697
- run:
698698
name: Clippy linting on crypto
699699
working_directory: ~/project/packages/crypto
700-
command: cargo clippy --tests -- -D warnings
700+
command: cargo clippy --all-targets -- -D warnings
701701
- run:
702702
name: Clippy linting on schema
703703
working_directory: ~/project/packages/schema
704-
command: cargo clippy --tests -- -D warnings
704+
command: cargo clippy --all-targets -- -D warnings
705705
- run:
706706
name: Clippy linting on std (no feature flags)
707707
working_directory: ~/project/packages/std
708-
command: cargo clippy --tests -- -D warnings
708+
command: cargo clippy --all-targets -- -D warnings
709709
- run:
710710
name: Clippy linting on std (all feature flags)
711711
working_directory: ~/project/packages/std
712-
command: cargo clippy --tests --features iterator,staking -- -D warnings
712+
command: cargo clippy --all-targets --features iterator,staking -- -D warnings
713713
- run:
714714
name: Clippy linting on storage (no feature flags)
715715
working_directory: ~/project/packages/storage
716-
command: cargo clippy --tests -- -D warnings
716+
command: cargo clippy --all-targets -- -D warnings
717717
- run:
718718
name: Clippy linting on storage (all feature flags)
719719
working_directory: ~/project/packages/storage
720-
command: cargo clippy --tests --features iterator -- -D warnings
720+
command: cargo clippy --all-targets --features iterator -- -D warnings
721721
- run:
722722
name: Clippy linting on vm (no feature flags)
723723
working_directory: ~/project/packages/vm
724-
command: cargo clippy --tests --no-default-features -- -D warnings
724+
command: cargo clippy --all-targets --no-default-features -- -D warnings
725725
- run:
726726
name: Clippy linting on vm (all feature flags)
727727
working_directory: ~/project/packages/vm
728-
command: cargo clippy --tests --features iterator,staking,stargate -- -D warnings
728+
command: cargo clippy --all-targets --features iterator,staking,stargate -- -D warnings
729729
#
730730
# Contracts
731731
#
@@ -735,56 +735,56 @@ jobs:
735735
command: |
736736
mkdir -p target/wasm32-unknown-unknown/release
737737
touch target/wasm32-unknown-unknown/release/burner.wasm
738-
cargo clippy --tests -- -D warnings
738+
cargo clippy --all-targets -- -D warnings
739739
- run:
740740
name: Clippy linting on crypto-verify
741741
working_directory: ~/project/contracts/crypto-verify
742742
command: |
743743
mkdir -p target/wasm32-unknown-unknown/release
744744
touch target/wasm32-unknown-unknown/release/crypto_verify.wasm
745-
cargo clippy --tests -- -D warnings
745+
cargo clippy --all-targets -- -D warnings
746746
- run:
747747
name: Clippy linting on hackatom
748748
working_directory: ~/project/contracts/hackatom
749749
command: |
750750
mkdir -p target/wasm32-unknown-unknown/release
751751
touch target/wasm32-unknown-unknown/release/hackatom.wasm
752-
cargo clippy --tests -- -D warnings
752+
cargo clippy --all-targets -- -D warnings
753753
- run:
754754
name: Clippy linting on ibc-reflect
755755
working_directory: ~/project/contracts/ibc-reflect
756756
command: |
757757
mkdir -p target/wasm32-unknown-unknown/release
758758
touch target/wasm32-unknown-unknown/release/ibc_reflect.wasm
759-
cargo clippy --tests -- -D warnings
759+
cargo clippy --all-targets -- -D warnings
760760
- run:
761761
name: Clippy linting on ibc-reflect-send
762762
working_directory: ~/project/contracts/ibc-reflect-send
763763
command: |
764764
mkdir -p target/wasm32-unknown-unknown/release
765765
touch target/wasm32-unknown-unknown/release/ibc_reflect_send.wasm
766-
cargo clippy --tests -- -D warnings
766+
cargo clippy --all-targets -- -D warnings
767767
- run:
768768
name: Clippy linting on queue
769769
working_directory: ~/project/contracts/queue
770770
command: |
771771
mkdir -p target/wasm32-unknown-unknown/release
772772
touch target/wasm32-unknown-unknown/release/queue.wasm
773-
cargo clippy --tests -- -D warnings
773+
cargo clippy --all-targets -- -D warnings
774774
- run:
775775
name: Clippy linting on reflect
776776
working_directory: ~/project/contracts/reflect
777777
command: |
778778
mkdir -p target/wasm32-unknown-unknown/release
779779
touch target/wasm32-unknown-unknown/release/reflect.wasm
780-
cargo clippy --tests -- -D warnings
780+
cargo clippy --all-targets -- -D warnings
781781
- run:
782782
name: Clippy linting on staking
783783
working_directory: ~/project/contracts/staking
784784
command: |
785785
mkdir -p target/wasm32-unknown-unknown/release
786786
touch target/wasm32-unknown-unknown/release/staking.wasm
787-
cargo clippy --tests -- -D warnings
787+
cargo clippy --all-targets -- -D warnings
788788
- save_cache:
789789
paths:
790790
- /usr/local/cargo/registry

devtools/check_contracts_full.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for contract_dir in contracts/*/; do
1111
cargo check --tests
1212
cargo unit-test
1313
touch src/*.rs # Needed because check and clippy share the same build cache such that clippy warnings are hidden when check wrote to the build cache
14-
cargo clippy --tests -- -D warnings
14+
cargo clippy --all-targets -- -D warnings
1515
cargo schema
1616
cargo wasm
1717
cargo integration-test

devtools/check_contracts_medium.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for contract_dir in contracts/*/; do
1111
cargo check --tests
1212
cargo unit-test
1313
touch src/*.rs # Needed because check and clippy share the same build cache such that clippy warnings are hidden when check wrote to the build cache
14-
cargo clippy --tests -- -D warnings
14+
cargo clippy --all-targets -- -D warnings
1515
cargo schema
1616
cargo wasm-debug
1717
)

devtools/check_workspace.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ set -o errexit -o nounset -o pipefail
33
command -v shellcheck >/dev/null && shellcheck "$0"
44

55
cargo fmt
6-
(cd packages/crypto && cargo build && cargo clippy --tests -- -D warnings)
7-
(cd packages/std && cargo wasm-debug --features iterator && cargo clippy --tests --features iterator -- -D warnings && cargo schema)
8-
(cd packages/storage && cargo build && cargo clippy --tests --features iterator -- -D warnings)
9-
(cd packages/schema && cargo build && cargo clippy --tests -- -D warnings)
10-
(cd packages/vm && cargo build --features iterator,stargate && cargo clippy --tests --features iterator,stargate -- -D warnings)
6+
(cd packages/crypto && cargo build && cargo clippy --all-targets -- -D warnings)
7+
(cd packages/std && cargo wasm-debug --features iterator && cargo clippy --all-targets --features iterator -- -D warnings && cargo schema)
8+
(cd packages/storage && cargo build && cargo clippy --all-targets --features iterator -- -D warnings)
9+
(cd packages/schema && cargo build && cargo clippy --all-targets -- -D warnings)
10+
(cd packages/vm && cargo build --features iterator,stargate && cargo clippy --all-targets --features iterator,stargate -- -D warnings)

packages/crypto/benches/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn read_cosmos_sigs() -> Vec<Encoded> {
5050
serde_json::from_reader(reader).unwrap()
5151
}
5252

53+
#[allow(clippy::type_complexity)]
5354
fn read_decode_cosmos_sigs() -> (Vec<Vec<u8>>, Vec<Vec<u8>>, Vec<Vec<u8>>) {
5455
let codes = read_cosmos_sigs();
5556

packages/vm/examples/module_size.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ pub fn main() {
6060
}
6161

6262
#[inline(never)]
63-
fn module_compile(wasm: &Vec<u8>, memory_limit: Option<Size>) -> Module {
63+
fn module_compile(wasm: &[u8], memory_limit: Option<Size>) -> Module {
6464
compile(&wasm, memory_limit).unwrap()
6565
}
6666

6767
#[inline(never)]
68-
fn module_deserialize(serialized: &Vec<u8>, memory_limit: Option<Size>) -> Module {
68+
fn module_deserialize(serialized: &[u8], memory_limit: Option<Size>) -> Module {
6969
// Deserialize using make_runtime_store()
7070
let store = make_runtime_store(memory_limit);
7171
unsafe { Module::deserialize(&store, serialized) }.unwrap()

packages/vm/examples/multi_threaded_cache.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ pub fn main() {
3232
instance_memory_limit: DEFAULT_MEMORY_LIMIT,
3333
};
3434

35-
let cache: Cache<MockApi, MockStorage, MockQuerier> =
36-
unsafe { Cache::new(options.clone()).unwrap() };
35+
let cache: Cache<MockApi, MockStorage, MockQuerier> = unsafe { Cache::new(options).unwrap() };
3736
let cache = Arc::new(cache);
3837

3938
let checksum = cache.save_wasm(CONTRACT).unwrap();
@@ -51,7 +50,7 @@ pub fn main() {
5150
let cache = Arc::clone(&cache);
5251

5352
threads.push(thread::spawn(move || {
54-
let checksum = checksum.clone();
53+
let checksum = checksum;
5554
let mut instance = cache
5655
.get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS)
5756
.unwrap();

0 commit comments

Comments
 (0)