Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/cargo-contract/src/cmd/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ impl BuildCommand {
false => Network::Online,
};

// The invocation of `cargo dylint` requires network access, so in offline mode the linting
// step must be skipped otherwise the build can fail.
let skip_linting = self.skip_linting || matches!(network, Network::Offline);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a comment as to why we skip linting in this case


let output_type = match self.output_json {
true => OutputType::Json,
false => OutputType::HumanReadable,
Expand All @@ -207,7 +211,7 @@ impl BuildCommand {
unstable_flags,
optimization_passes,
keep_debug_symbols: self.keep_debug_symbols,
skip_linting: self.skip_linting,
skip_linting,
output_type,
};

Expand Down