diff --git a/third_party/move/tools/move-linter/Cargo.toml b/third_party/move/tools/move-linter/Cargo.toml index afe01972cf03c..524e50e2c2fae 100644 --- a/third_party/move/tools/move-linter/Cargo.toml +++ b/third_party/move/tools/move-linter/Cargo.toml @@ -12,6 +12,12 @@ publish = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } +[lib] +doctest = false + +[features] +default = [] + [dependencies] codespan-reporting = { workspace = true } legacy-move-compiler = { workspace = true } @@ -25,12 +31,6 @@ num = { workspace = true } datatest-stable = { workspace = true } move-prover-test-utils = { workspace = true } -[features] -default = [] - [[test]] name = "testsuite" harness = false - -[lib] -doctest = false diff --git a/third_party/move/tools/move-linter/src/model_ast_lints.rs b/third_party/move/tools/move-linter/src/model_ast_lints.rs index fba01419683f0..e59daa7ffc48b 100644 --- a/third_party/move/tools/move-linter/src/model_ast_lints.rs +++ b/third_party/move/tools/move-linter/src/model_ast_lints.rs @@ -8,6 +8,7 @@ mod almost_swapped; mod assert_const; mod blocks_in_conditions; mod cyclomatic_complexity; +mod empty_if; mod equal_operands_in_bin_op; mod find_unnecessary_casts; mod known_to_abort; @@ -34,6 +35,7 @@ pub fn get_default_linter_pipeline(config: &BTreeMap) -> Vec::default(), Box::::default(), Box::::default(), + Box::::default(), Box::::default(), Box::::default(), Box::::default(), diff --git a/third_party/move/tools/move-linter/src/model_ast_lints/empty_if.rs b/third_party/move/tools/move-linter/src/model_ast_lints/empty_if.rs new file mode 100644 index 0000000000000..681fc2ad189ed --- /dev/null +++ b/third_party/move/tools/move-linter/src/model_ast_lints/empty_if.rs @@ -0,0 +1,58 @@ +// Copyright (c) Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This module implements an expression linter that checks for empty `else` branches +//! public fun empty_if(x: u64): u64 { +//! if (x > 35) { // <---- +//! } else { +//! x = x + 1; +//! }; +//! x +//! } + +use move_compiler_v2::external_checks::ExpChecker; +use move_model::{ + ast::{ExpData, Operation}, + model::FunctionEnv, +}; + +#[derive(Default)] +pub struct EmptyIf; + +impl ExpChecker for EmptyIf { + fn get_name(&self) -> String { + "empty_if".to_string() + } + + fn visit_expr_pre(&mut self, function: &FunctionEnv, expr: &ExpData) { + let ExpData::IfElse(full_nid, .., if_branch, else_branch) = expr else { + return; + }; + + let ExpData::Call(_, Operation::Tuple, args) = if_branch.as_ref() else { + return; + }; + + if !args.is_empty() { + return; + } + + if let ExpData::Call(_, Operation::Abort, _) = else_branch.as_ref() { + return; + } + + let genv = function.env(); + + let message = match else_branch.as_ref() { + ExpData::Call(.., Operation::Tuple, eargs) if eargs.is_empty() => { + "Empty `if` branch. Consider simplifying by removing or rewriting." + }, + ExpData::LoopCont(_, _, _) => { + return; + }, + _ => "Empty `if` branch. Consider simplifying this `if-else`.", + }; + + self.report(genv, &genv.get_node_loc(*full_nid), message); + } +} diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/almost_swapped.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/almost_swapped.exp index cc066b8e5f376..3d74008318d19 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/almost_swapped.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/almost_swapped.exp @@ -10,6 +10,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:13:5 + │ +13 │ if (y == x) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:19:5 │ @@ -20,6 +29,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:21:5 + │ +21 │ if (x2 == x1) (); + │ ^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:27:5 │ @@ -70,6 +88,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:54:5 + │ +54 │ if (y2 == y1) (); + │ ^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:61:5 │ @@ -100,6 +127,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:74:5 + │ +74 │ if (y4 == y3) () + │ ^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:80:5 │ @@ -130,6 +166,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:90:5 + │ +90 │ if (y == x) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:98:5 │ @@ -140,6 +185,15 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:100:5 + │ +100 │ if (v1 == v2) (); + │ ^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This looks like a swap, but one assignment overwrites the other. ┌─ tests/model_ast_lints/almost_swapped.move:111:5 │ @@ -149,3 +203,30 @@ warning: [lint] This looks like a swap, but one assignment overwrites the other. │ = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(almost_swapped)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#almost_swapped. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:120:5 + │ +120 │ if (y == x) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:153:5 + │ +153 │ if (x2 == x1) (); + │ ^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/almost_swapped.move:162:5 + │ +162 │ if (y == x) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.exp new file mode 100644 index 0000000000000..7d587e75220ec --- /dev/null +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.exp @@ -0,0 +1,56 @@ + +Diagnostics: +warning: [lint] Empty `if` branch. Consider simplifying this `if-else`. + ┌─ tests/model_ast_lints/empty_if.move:4:9 + │ +4 │ ╭ if (x > 0) { +5 │ │ } else { +6 │ │ return; +7 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/empty_if.move:11:9 + │ +11 │ ╭ if (x > 0) { +12 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/empty_if.move:23:9 + │ +23 │ ╭ if (x > 0) { +24 │ │ () +25 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/empty_if.move:30:9 + │ +30 │ ╭ if (x > 35) { +31 │ │ } else { }; + │ ╰──────────────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying this `if-else`. + ┌─ tests/model_ast_lints/empty_if.move:36:9 + │ +36 │ ╭ if (x > 35) { +37 │ │ } else { +38 │ │ return 2; +39 │ │ }; + │ ╰──────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.move b/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.move new file mode 100644 index 0000000000000..34e0ccd13c02c --- /dev/null +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/empty_if.move @@ -0,0 +1,60 @@ +module 0xc0ffee::m { + + public fun empty_if(x: u64) { + if (x > 0) { + } else { + return; + }; + } + + public fun empty_if_no_else(x: u64) { + if (x > 0) { + }; + } + + public fun non_empty_if(x: u64): u64 { + if (x > 0) { + x = x + 1; + }; + x + } + + public fun empty_if_with_void(x: u64): u64 { + if (x > 0) { + () + }; + x + } + + public fun empty_if_with_empty_else(x: u64): u64 { + if (x > 35) { + } else { }; + 0 + } + + public fun empty_if_with_non_empty_else(x: u64): u64 { + if (x > 35) { + } else { + return 2; + }; + 0 + } + + public fun aborts(x: u64) { + assert!(x > 10); + } + + #[lint::skip(empty_if)] + public fun skip_empty_if(x: u64) { + if (x > 35) { + } else { }; + } + + public fun dont_flag_abort_on_else(x: u64) { + if (x > 0) { + } else { + abort(0) + }; + } + +} diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/find_unnecessary_casts_test.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/find_unnecessary_casts_test.exp index 1b5b93b035ec4..458a5138f9b1c 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/find_unnecessary_casts_test.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/find_unnecessary_casts_test.exp @@ -54,6 +54,15 @@ warning: [lint] Unnecessary cast: the expression is already of the target type. = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(find_unnecessary_casts)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#find_unnecessary_casts. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/find_unnecessary_casts_test.move:38:9 + │ +38 │ if ((x as u64) > 0) { }; + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] Unnecessary cast: the expression is already of the target type. Consider removing the cast for better readability. ┌─ tests/model_ast_lints/find_unnecessary_casts_test.move:43:17 │ diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_01.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_01.exp index ed27fb8463f6f..acb6a80649147 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_01.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_01.exp @@ -1,5 +1,16 @@ Diagnostics: +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/multi_attributes_01.move:4:9 + │ +4 │ ╭ if ({let y = x + 1; y < 5}) { +5 │ │ // do nothing +6 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] Having blocks in conditions make code harder to read. Consider rewriting this code. ┌─ tests/model_ast_lints/multi_attributes_01.move:13:13 │ @@ -9,6 +20,17 @@ warning: [lint] Having blocks in conditions make code harder to read. Consider r = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(blocks_in_conditions)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#blocks_in_conditions. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/multi_attributes_01.move:13:9 + │ +13 │ ╭ if ({let y = x + 1; y < 5}) { +14 │ │ // do nothing +15 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] Use the more explicit `loop` instead. ┌─ tests/model_ast_lints/multi_attributes_01.move:16:9 │ diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_02.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_02.exp index 144ada2dd20d1..2ca707ebe9426 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_02.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/multi_attributes_02.exp @@ -1,2 +1,23 @@ -No errors or warnings! +Diagnostics: +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/multi_attributes_02.move:5:9 + │ +5 │ ╭ if ({let y = x + 1; y < 5}) { +6 │ │ // do nothing +7 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/multi_attributes_02.move:15:9 + │ +15 │ ╭ if ({let y = x + 1; y < 5}) { +16 │ │ // do nothing +17 │ │ }; + │ ╰─────────^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/nonminimal_bool.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/nonminimal_bool.exp index 8fc0ed443732a..2d1070a48ed80 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/nonminimal_bool.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/nonminimal_bool.exp @@ -9,6 +9,15 @@ warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:4:9 + │ +4 │ if (true && x) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `&&` evaluates to `true`. Recall that the expression `bexpr && true` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:5:13 │ @@ -18,6 +27,15 @@ warning: [lint] The right-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:5:9 + │ +5 │ if (x && true) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `false`. Recall that the expression `false && bexpr` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:6:13 │ @@ -27,6 +45,15 @@ warning: [lint] The left-hand side of `&&` evaluates to `false`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:6:9 + │ +6 │ if (false && x) (); + │ ^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `&&` evaluates to `false`. Recall that the expression `bexpr && false` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:7:13 │ @@ -36,6 +63,15 @@ warning: [lint] The right-hand side of `&&` evaluates to `false`. Recall that th = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:7:9 + │ +7 │ if (x && false) (); + │ ^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `||` evaluates to `true`. Recall that the expression `true || bexpr` is logically equivalent to `true`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:11:13 │ @@ -45,6 +81,15 @@ warning: [lint] The left-hand side of `||` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:11:9 + │ +11 │ if (true || x) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `||` evaluates to `true`. Recall that the expression `bexpr || true` is logically equivalent to `true`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:12:13 │ @@ -54,6 +99,15 @@ warning: [lint] The right-hand side of `||` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:12:9 + │ +12 │ if (x || true) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the expression `false || bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:13:13 │ @@ -63,6 +117,15 @@ warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:13:9 + │ +13 │ if (false || x) (); + │ ^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `||` evaluates to `false`. Recall that the expression `bexpr || false` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:14:13 │ @@ -72,6 +135,15 @@ warning: [lint] The right-hand side of `||` evaluates to `false`. Recall that th = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:14:9 + │ +14 │ if (x || false) (); + │ ^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `<==>` evaluates to `true`. Recall that the expression `bexpr <==> true` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:19:20 │ @@ -153,6 +225,15 @@ warning: [lint] This expression evaluates to `false`. Recall that the expression = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:36:9 + │ +36 │ if (!true) (); + │ ^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `true`. Recall that the expression `!false` is logically equivalent to `true`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:37:13 │ @@ -162,6 +243,15 @@ warning: [lint] This expression evaluates to `true`. Recall that the expression = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:37:9 + │ +37 │ if (!false) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `false`. Recall that the expression `!true` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/nonminimal_bool.move:42:13 │ @@ -188,3 +278,12 @@ warning: [lint] The right-hand side of `||` evaluates to `true`. Recall that the │ = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/nonminimal_bool.move:42:9 + │ +42 │ if (!true && false || true) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. diff --git a/third_party/move/tools/move-linter/tests/model_ast_lints/simpler_bool_expression.exp b/third_party/move/tools/move-linter/tests/model_ast_lints/simpler_bool_expression.exp index f6dca0c86f518..bca47a8fe69bf 100644 --- a/third_party/move/tools/move-linter/tests/model_ast_lints/simpler_bool_expression.exp +++ b/third_party/move/tools/move-linter/tests/model_ast_lints/simpler_bool_expression.exp @@ -9,6 +9,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:29:9 + │ +29 │ if (!!a) (); + │ ^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:36:13 │ @@ -18,6 +27,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:36:9 + │ +36 │ if (!!a) (); + │ ^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:37:13 │ @@ -27,6 +45,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:37:9 + │ +37 │ if (!(!b)) (); + │ ^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:43:13 │ @@ -36,6 +63,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:43:9 + │ +43 │ if (!!flags.a) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:44:13 │ @@ -45,6 +81,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:44:9 + │ +44 │ if (!(!flags.b)) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:53:13 │ @@ -54,6 +99,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:53:9 + │ +53 │ if (!!nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:54:13 │ @@ -63,6 +117,15 @@ warning: [lint] This boolean expression can be simplified using double negation = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:54:9 + │ +54 │ if (!(!nested.enabled)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:62:13 │ @@ -72,6 +135,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:62:9 + │ +62 │ if (a && b || a) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:63:13 │ @@ -81,6 +153,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:63:9 + │ +63 │ if (a || a && b) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:70:13 │ @@ -90,6 +171,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:70:9 + │ +70 │ if (x && y || x) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:71:13 │ @@ -99,6 +189,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:71:9 + │ +71 │ if (x || x && y) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the expression `true && bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:75:13 │ @@ -126,6 +225,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:75:9 + │ +75 │ if (TRUE_CONST && FALSE_CONST || TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `false`. Recall that the expression `false && bexpr` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:76:28 │ @@ -153,6 +261,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:76:9 + │ +76 │ if (FALSE_CONST || FALSE_CONST && TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:82:13 │ @@ -162,6 +279,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:82:9 + │ +82 │ if (flags.a && flags.b || flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:83:13 │ @@ -171,6 +297,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:83:9 + │ +83 │ if (flags.a || flags.a && flags.b) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:92:13 │ @@ -180,6 +315,15 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:92:9 + │ +92 │ if (nested.flags.a && nested.enabled || nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using absorption law (`a && b || a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:93:13 │ @@ -189,6 +333,33 @@ warning: [lint] This boolean expression can be simplified using absorption law ( = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:93:9 + │ +93 │ if (nested.flags.a || nested.flags.a && nested.enabled) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:101:9 + │ +101 │ if ((helper_function()) && p > 10 || helper_function()) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:102:9 + │ +102 │ if ((x == helper_function()) || x == helper_function() && p > 10) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using double negation law (`!!a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:110:13 │ @@ -207,6 +378,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:110:9 + │ +110 │ if (!!a && !a) (); + │ ^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:111:13 │ @@ -216,6 +396,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:111:9 + │ +111 │ if (a && a) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:112:13 │ @@ -225,6 +414,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:112:9 + │ +112 │ if (a || a) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:118:13 │ @@ -234,6 +432,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:118:9 + │ +118 │ if (flag && flag) (); + │ ^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:119:13 │ @@ -243,6 +450,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:119:9 + │ +119 │ if (flag || flag) (); + │ ^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the expression `true && bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:124:13 │ @@ -252,6 +468,15 @@ warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:124:9 + │ +124 │ if (TRUE_CONST && TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the expression `false || bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:125:13 │ @@ -261,6 +486,15 @@ warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:125:9 + │ +125 │ if (FALSE_CONST || FALSE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:131:13 │ @@ -270,6 +504,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:131:9 + │ +131 │ if (flags.a && flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:132:13 │ @@ -279,6 +522,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:132:9 + │ +132 │ if (flags.b || flags.b) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:141:13 │ @@ -288,6 +540,15 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:141:9 + │ +141 │ if (nested.flags.a && nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using idempotence (`a && a` is equivalent to `a`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:142:13 │ @@ -297,6 +558,33 @@ warning: [lint] This boolean expression can be simplified using idempotence (`a = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:142:9 + │ +142 │ if (nested.flags.b || nested.flags.b) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:149:9 + │ +149 │ if ((x == helper_function()) && (x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:150:9 + │ +150 │ if ((x == helper_function()) || (x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:160:13 │ @@ -306,6 +594,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:160:9 + │ +160 │ if (a && !a) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:161:13 │ @@ -315,6 +612,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:161:9 + │ +161 │ if (!a && a) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:162:13 │ @@ -324,6 +630,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:162:9 + │ +162 │ if (a || !a) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:163:13 │ @@ -333,6 +648,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:163:9 + │ +163 │ if (!a || a) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:169:13 │ @@ -342,6 +666,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:169:9 + │ +169 │ if (condition && !condition) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:170:13 │ @@ -351,6 +684,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:170:9 + │ +170 │ if (!condition && condition) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:171:13 │ @@ -360,6 +702,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:171:9 + │ +171 │ if (condition || !condition) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:172:13 │ @@ -369,6 +720,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:172:9 + │ +172 │ if (!condition || condition) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `false`. Recall that the expression `!true` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:177:27 │ @@ -387,6 +747,15 @@ warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:177:9 + │ +177 │ if (TRUE_CONST && !TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `false`. Recall that the expression `!true` is logically equivalent to `false`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:178:13 │ @@ -405,6 +774,15 @@ warning: [lint] The right-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:178:9 + │ +178 │ if (!TRUE_CONST && TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `true`. Recall that the expression `!false` is logically equivalent to `true`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:179:28 │ @@ -423,6 +801,15 @@ warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:179:9 + │ +179 │ if (FALSE_CONST || !FALSE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This expression evaluates to `true`. Recall that the expression `!false` is logically equivalent to `true`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:180:13 │ @@ -441,6 +828,15 @@ warning: [lint] The right-hand side of `||` evaluates to `false`. Recall that th = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:180:9 + │ +180 │ if (!FALSE_CONST || FALSE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:186:13 │ @@ -450,6 +846,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:186:9 + │ +186 │ if (flags.a && !flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:187:13 │ @@ -459,6 +864,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:187:9 + │ +187 │ if (!flags.a && flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:188:13 │ @@ -468,6 +882,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:188:9 + │ +188 │ if (flags.a || !flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:189:13 │ @@ -477,6 +900,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:189:9 + │ +189 │ if (!flags.a || flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:198:13 │ @@ -486,6 +918,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:198:9 + │ +198 │ if (nested.flags.a && !nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using contradiction (`a && !a` is equivalent to `false`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:199:13 │ @@ -495,6 +936,15 @@ warning: [lint] This boolean expression can be simplified using contradiction (` = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:199:9 + │ +199 │ if (!nested.flags.a && nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:200:13 │ @@ -504,6 +954,15 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:200:9 + │ +200 │ if (nested.flags.a || !nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using tautology (`a || !a` is equivalent to `true`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:201:13 │ @@ -513,6 +972,51 @@ warning: [lint] This boolean expression can be simplified using tautology (`a || = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:201:9 + │ +201 │ if (!nested.flags.a || nested.flags.a) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:208:9 + │ +208 │ if ((x == helper_function()) && !(x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:209:9 + │ +209 │ if (!(x == helper_function()) && (x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:210:9 + │ +210 │ if ((x == helper_function()) || !(x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:211:9 + │ +211 │ if (!(x == helper_function()) || (x == helper_function())) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:219:13 │ @@ -522,6 +1026,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:219:9 + │ +219 │ if ((a && b) || (a && c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:220:13 │ @@ -531,6 +1044,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:220:9 + │ +220 │ if ((a || b) && (a || c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:228:13 │ @@ -540,6 +1062,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:228:9 + │ +228 │ if ((a && b) || (a && c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:229:13 │ @@ -549,6 +1080,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:229:9 + │ +229 │ if ((a || b) && (a || c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the expression `true && bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:233:13 │ @@ -576,6 +1116,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:233:9 + │ +233 │ if ((TRUE_CONST && FALSE_CONST) || (TRUE_CONST && TRUE_CONST)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the expression `false || bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:234:13 │ @@ -603,6 +1152,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:234:9 + │ +234 │ if ((FALSE_CONST || FALSE_CONST) && (FALSE_CONST || TRUE_CONST)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:241:13 │ @@ -612,6 +1170,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:241:9 + │ +241 │ if ((flags.a && other.a) || (flags.a && other.c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:242:13 │ @@ -621,6 +1188,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:242:9 + │ +242 │ if ((flags.a || other.a) && (flags.a || other.c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:251:13 │ @@ -630,6 +1206,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:251:9 + │ +251 │ if ((nested.flags.a && nested.enabled) || (nested.flags.a && nested.flags.c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] This boolean expression can be simplified using distributive law (`(a && b) || (a && c)` is equivalent to `a && (b || c)`). ┌─ tests/model_ast_lints/simpler_bool_expression.move:252:13 │ @@ -639,6 +1224,15 @@ warning: [lint] This boolean expression can be simplified using distributive law = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(simpler_bool_expression)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#simpler_bool_expression. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:252:9 + │ +252 │ if ((nested.flags.a || nested.enabled) && (nested.flags.a || nested.flags.c)) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `&&` evaluates to `true`. Recall that the expression `bexpr && true` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:259:13 │ @@ -648,6 +1242,15 @@ warning: [lint] The right-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:259:9 + │ +259 │ if ((helper_function() && TRUE_CONST) || (helper_function() && (y > 10))) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The right-hand side of `||` evaluates to `false`. Recall that the expression `bexpr || false` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:260:13 │ @@ -657,6 +1260,78 @@ warning: [lint] The right-hand side of `||` evaluates to `false`. Recall that th = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:260:9 + │ +260 │ if ((helper_function() || FALSE_CONST) && (helper_function() || (y > 10))) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:271:9 + │ +271 │ if (a && a) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:272:9 + │ +272 │ if (b || !b) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:273:9 + │ +273 │ if (a && !a) (); + │ ^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:279:9 + │ +279 │ if (a && b || c) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:280:9 + │ +280 │ if (c || a && b) (); + │ ^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:287:9 + │ +287 │ if (a && b) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:288:9 + │ +288 │ if (b || a) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the expression `true && bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:292:13 │ @@ -666,6 +1341,15 @@ warning: [lint] The left-hand side of `&&` evaluates to `true`. Recall that the = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:292:9 + │ +292 │ if (TRUE_CONST && FALSE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the expression `false || bexpr` is logically equivalent to `bexpr`. Consider simplifying. ┌─ tests/model_ast_lints/simpler_bool_expression.move:293:13 │ @@ -674,3 +1358,120 @@ warning: [lint] The left-hand side of `||` evaluates to `false`. Recall that the │ = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(nonminimal_bool)]`. = For more information, see https://aptos.dev/en/build/smart-contracts/linter#nonminimal_bool. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:293:9 + │ +293 │ if (FALSE_CONST || TRUE_CONST) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:299:9 + │ +299 │ if (flags.a && flags.b) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:300:9 + │ +300 │ if (flags.a || flags.c) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:301:9 + │ +301 │ if (!flags.a && flags.b) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:302:9 + │ +302 │ if (flags.b && !flags.c) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:311:9 + │ +311 │ if (nested.flags.a && nested.enabled) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:312:9 + │ +312 │ if (nested.flags.a || nested.enabled) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:313:9 + │ +313 │ if (!nested.flags.a && nested.enabled) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:314:9 + │ +314 │ if (nested.flags.a && !nested.enabled) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:321:9 + │ +321 │ if (x && y) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:322:9 + │ +322 │ if (x || y) (); + │ ^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:331:9 + │ +331 │ if (new_vec[0] && new_vec[0]) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if. + +warning: [lint] Empty `if` branch. Consider simplifying by removing or rewriting. + ┌─ tests/model_ast_lints/simpler_bool_expression.move:332:9 + │ +332 │ if (new_vec[1] || new_vec[1]) (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ + = To suppress this warning, annotate the function/module with the attribute `#[lint::skip(empty_if)]`. + = For more information, see https://aptos.dev/en/build/smart-contracts/linter#empty_if.