File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
use super :: { install, watch:: WatchArgs } ;
2
2
use clap:: Parser ;
3
- use eyre:: { Result , eyre } ;
3
+ use eyre:: { Context , Result } ;
4
4
use forge_lint:: { linter:: Linter , sol:: SolidityLinter } ;
5
5
use foundry_cli:: {
6
6
opts:: BuildOpts ,
@@ -115,7 +115,7 @@ impl BuildArgs {
115
115
// Only run the `SolidityLinter` if lint on build and no compilation errors.
116
116
if config. lint . lint_on_build && !output. output ( ) . errors . iter ( ) . any ( |e| e. is_error ( ) ) {
117
117
self . lint ( & project, & config, self . paths . as_deref ( ) , & mut output)
118
- . map_err ( |err| eyre ! ( "Lint failed: {err}" ) ) ?;
118
+ . wrap_err ( "Lint failed" ) ?;
119
119
}
120
120
121
121
Ok ( output)
Original file line number Diff line number Diff line change @@ -223,6 +223,8 @@ impl<'a> Linter for SolidityLinter<'a> {
223
223
type Lint = SolLint ;
224
224
225
225
fn lint ( & self , input : & [ PathBuf ] , compiler : & mut Compiler ) -> eyre:: Result < ( ) > {
226
+ convert_solar_errors ( compiler. dcx ( ) ) ?;
227
+
226
228
let ui_testing = std:: env:: var_os ( "FOUNDRY_LINT_UI_TESTING" ) . is_some ( ) ;
227
229
228
230
let sm = compiler. sess ( ) . clone_source_map ( ) ;
@@ -241,9 +243,8 @@ impl<'a> Linter for SolidityLinter<'a> {
241
243
}
242
244
243
245
compiler. enter_mut ( |compiler| -> eyre:: Result < ( ) > {
244
- if compiler. gcx ( ) . stage ( ) == Some ( solar:: config:: CompilerStage :: Parsing ) {
246
+ if compiler. gcx ( ) . stage ( ) < Some ( solar:: config:: CompilerStage :: Lowering ) {
245
247
let _ = compiler. lower_asts ( ) ;
246
- convert_solar_errors ( compiler. dcx ( ) ) ?;
247
248
}
248
249
249
250
let gcx = compiler. gcx ( ) ;
@@ -272,7 +273,7 @@ impl<'a> Linter for SolidityLinter<'a> {
272
273
let _ = self . process_source_hir ( gcx, hir_source_id, path, & inline_config) ;
273
274
} ) ;
274
275
275
- Ok ( ( ) )
276
+ convert_solar_errors ( compiler . dcx ( ) )
276
277
} ) ?;
277
278
278
279
let sess = compiler. sess_mut ( ) ;
@@ -282,7 +283,7 @@ impl<'a> Linter for SolidityLinter<'a> {
282
283
sess. reconfigure ( ) ;
283
284
}
284
285
285
- convert_solar_errors ( compiler . dcx ( ) )
286
+ Ok ( ( ) )
286
287
}
287
288
}
288
289
You can’t perform that action at this time.
0 commit comments