Skip to content

Commit

Permalink
Revert "Use nightly for clippy and rustfmt (#1372)"
Browse files Browse the repository at this point in the history
This reverts commit c28c0cf.
  • Loading branch information
agryaznov committed Oct 19, 2022
1 parent c28c0cf commit c5a81ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 43 deletions.
54 changes: 17 additions & 37 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ variables:
ALL_CRATES: "${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}"
DELEGATOR_SUBCONTRACTS: "accumulator adder subber"
UPGRADEABLE_CONTRACTS: "forward-calls delegate-calls"
# We need to enable `RUSTC_BOOTSTRAP` so that the nightly ink!
# features still work on stable. This is done automatically by
# `cargo-contract`, but in our CI here we also use e.g.
# `cargo check` directly.
RUSTC_BOOTSTRAP: "1"

workflow:
rules:
Expand Down Expand Up @@ -105,10 +100,10 @@ fmt:
<<: *docker-env
<<: *test-refs
script:
- cargo +nightly fmt --verbose --all -- --check
- cargo fmt --verbose --all -- --check
# For the UI tests we need to disable the license check
- cargo +nightly fmt --verbose --all -- --check ./crates/lang/tests/ui/contract/{pass,fail}/*.rs
- cargo +nightly fmt --verbose --all -- --check ./crates/lang/tests/ui/trait_def/{pass,fail}/*.rs
- cargo fmt --verbose --all -- --check ./crates/lang/tests/ui/contract/{pass,fail}/*.rs
- cargo fmt --verbose --all -- --check ./crates/lang/tests/ui/trait_def/{pass,fail}/*.rs
allow_failure: true

examples-fmt:
Expand All @@ -119,15 +114,15 @@ examples-fmt:
# Note that we disable the license header check for the examples, since they are unlicensed.
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo +nightly fmt --verbose --manifest-path ${example}/Cargo.toml -- --check;
cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo +nightly fmt --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml -- --check;
cargo fmt --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml -- --check;
done
- for contract in ${UPGRADEABLE_CONTRACTS}; do
cargo +nightly fmt --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- --check;
cargo fmt --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- --check;
done
- cargo +nightly fmt --verbose --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml -- --check
- cargo fmt --verbose --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml -- --check
allow_failure: true

clippy-std:
Expand All @@ -136,7 +131,7 @@ clippy-std:
<<: *test-refs
script:
- for crate in ${ALL_CRATES}; do
cargo +nightly clippy --verbose --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml -- -D warnings;
done

clippy-wasm:
Expand All @@ -145,7 +140,7 @@ clippy-wasm:
<<: *test-refs
script:
- for crate in ${ALSO_WASM_CRATES}; do
cargo +nightly clippy --verbose --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings;
done
allow_failure: true

Expand All @@ -156,15 +151,15 @@ examples-clippy-std:
script:
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo +nightly clippy --verbose --all-targets --manifest-path ${example}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ${example}/Cargo.toml -- -D warnings;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/delegator/${contract}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ./examples/delegator/${contract}/Cargo.toml -- -D warnings;
done
- for contract in ${UPGRADEABLE_CONTRACTS}; do
cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings;
done
- cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml -- -D warnings;
- cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml -- -D warnings;
allow_failure: true

examples-clippy-wasm:
Expand All @@ -174,15 +169,15 @@ examples-clippy-wasm:
script:
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo +nightly clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo +nightly clippy --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
done
- for contract in ${UPGRADEABLE_CONTRACTS}; do
cargo +nightly clippy --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
done
- cargo +nightly clippy --verbose --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
- cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
allow_failure: true


Expand All @@ -206,21 +201,6 @@ check-wasm:
cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ./crates/${crate}/Cargo.toml;
done

dylint:
stage: check
<<: *docker-env
<<: *test-refs
script:
- cd linting/
# we are using a toolchain file in this directory
# add required components for CI
- rustup component add rustfmt clippy
- cargo check --verbose
- cargo +nightly fmt --verbose --all -- --check
- cargo clippy --verbose -- -D warnings;
# Needed until https://github.com/mozilla/sccache/issues/1000 is fixed.
- unset RUSTC_WRAPPER
- cargo test --verbose --all-features

#### stage: workspace

Expand Down
6 changes: 0 additions & 6 deletions crates/lang/tests/unique_topics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
// TODO `cargo clippy --verbose --all-targets --all-features` for this crate
// fails on `stable`, but succeeds on `nightly`. I can't find the unused lifetime
// and assume it's a bug in `stable` (there are some recently closed issues for
// `clippy` that match). Remove the following line again as soon as `clippy` on
// stable would succeed again
#![allow(clippy::extra_unused_lifetimes)]

use ink_lang as ink;

Expand Down

0 comments on commit c5a81ad

Please sign in to comment.