From af7df439dc290fdb121161d16f42e13d4582ae81 Mon Sep 17 00:00:00 2001 From: Vineeth Kashyap Date: Thu, 16 Jan 2025 16:00:23 -0500 Subject: [PATCH] Linter returns non-zero exit code on warnings --- aptos-move/framework/src/built_package.rs | 4 ++-- third_party/move/move-compiler-v2/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aptos-move/framework/src/built_package.rs b/aptos-move/framework/src/built_package.rs index b79095ed4cc2a..def5da75b83a1 100644 --- a/aptos-move/framework/src/built_package.rs +++ b/aptos-move/framework/src/built_package.rs @@ -272,7 +272,7 @@ impl BuiltPackage { if let Some(model_options) = model.get_extension::() { if model_options.experiment_on(Experiment::STOP_BEFORE_EXTENDED_CHECKS) { - std::process::exit(0) + std::process::exit(if model.has_warnings() { 1 } else { 0 }) } } @@ -287,7 +287,7 @@ impl BuiltPackage { if let Some(model_options) = model.get_extension::() { if model_options.experiment_on(Experiment::STOP_AFTER_EXTENDED_CHECKS) { - std::process::exit(0) + std::process::exit(if model.has_warnings() { 1 } else { 0 }) } } diff --git a/third_party/move/move-compiler-v2/src/lib.rs b/third_party/move/move-compiler-v2/src/lib.rs index 3fa9674ba0cde..7d6f8cdbd1859 100644 --- a/third_party/move/move-compiler-v2/src/lib.rs +++ b/third_party/move/move-compiler-v2/src/lib.rs @@ -102,7 +102,7 @@ where check_errors(&env, emitter, "checking errors")?; if options.experiment_on(Experiment::STOP_BEFORE_STACKLESS_BYTECODE) { - std::process::exit(0) + std::process::exit(if env.has_warnings() { 1 } else { 0 }) } // Run code generator @@ -140,7 +140,7 @@ where check_errors(&env, emitter, "stackless-bytecode analysis errors")?; if options.experiment_on(Experiment::STOP_BEFORE_FILE_FORMAT) { - std::process::exit(0) + std::process::exit(if env.has_warnings() { 1 } else { 0 }) } let modules_and_scripts = run_file_format_gen(&mut env, &targets);