Skip to content

Commit 7722419

Browse files
committed
Nit: simplify lint cond
1 parent bb7987e commit 7722419

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

crates/forge/src/cmd/build.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,8 @@ impl BuildArgs {
112112
sh_println!("{}", serde_json::to_string_pretty(&output.output())?)?;
113113
}
114114

115-
if !config.lint.lint_on_build {
116-
return Ok(output);
117-
}
118-
119-
// Only run the `SolidityLinter` if there are no compilation errors
120-
if !output.output().errors.iter().any(|e| e.is_error()) {
115+
// Only run the `SolidityLinter` if lint on build and no compilation errors.
116+
if config.lint.lint_on_build && !output.output().errors.iter().any(|e| e.is_error()) {
121117
self.lint(&project, &config, self.paths.as_deref())
122118
.map_err(|err| eyre!("Lint failed: {err}"))?;
123119
}

0 commit comments

Comments
 (0)