Skip to content

Commit 27451a6

Browse files
committed
Add ink! linting MVP stage
1 parent 4195197 commit 27451a6

32 files changed

+1866
-287
lines changed

.github/workflows/macos.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
run: |
5151
wasm-opt --version
5252
cargo -vV
53+
cargo install cargo-dylint dylint-link
54+
cargo dylint --version
5355
cargo run -- contract --version
5456
cargo run -- contract new foobar
5557
echo "[workspace]" >> foobar/Cargo.toml

.github/workflows/windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
run: |
5454
wasm-opt --version
5555
cargo -vV
56+
cargo install cargo-dylint dylint-link
57+
cargo dylint --version
5658
cargo run -- contract --version
5759
cargo run -- contract new foobar
5860
echo "[workspace]" >> foobar/Cargo.toml

.gitlab-ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ workflow:
3939
- cargo -vV
4040
- rustc -vV
4141
- rustup show
42+
- cargo dylint --version
4243
- bash --version
4344
- ./scripts/ci/pre_cache.sh
4445
# global RUSTFLAGS overrides the linker args so this way is better to pass the flags
4546
- printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' > ${CARGO_HOME}/config
4647
- sccache -s
48+
49+
# needed until https://github.com/mozilla/sccache/issues/1000 is fixed.
50+
# this is unfortunate, since it disables `sccache` for this entire file.
51+
- unset RUSTC_WRAPPER
52+
4753
- git show
4854
rules:
4955
- if: $CI_PIPELINE_SOURCE == "web"
@@ -81,6 +87,26 @@ clippy:
8187

8288
#### stage: test (all features)
8389

90+
test-dylint:
91+
stage: test
92+
<<: *docker-env
93+
script:
94+
- cd ink_linting/
95+
96+
# Installing these components here is necessary because
97+
# `ink_linting/` has a fixed `rust-toolchain` file.
98+
# We can't move this line to the Docker container, since
99+
# that would then make it impossible to upgrade the
100+
# `ink_linting/rust-toolchain` file while still having
101+
# this CI job succeed.
102+
- rustup component add rustfmt clippy rust-src
103+
104+
- cargo check --verbose
105+
- cargo fmt --verbose --all -- --check
106+
- cargo clippy --verbose -- -D warnings;
107+
108+
- cargo test --verbose --workspace --all-features
109+
84110
test:
85111
stage: test
86112
<<: *docker-env

0 commit comments

Comments
 (0)