From 4c10d3e22d76db21121b52bb23e32f29db39b132 Mon Sep 17 00:00:00 2001 From: Christopher Chang <51393127+chriscerie@users.noreply.github.com> Date: Sun, 15 Oct 2023 15:23:41 -0700 Subject: [PATCH] Remove diff code when there are no changes --- selene-lib/src/lints/test_util.rs | 18 ++++++-- .../almost_swapped/almost_swapped.fixed.diff | 16 ------- .../lints/almost_swapped/panic.fixed.diff | 1 - .../lua51_string_escapes.fixed.diff | 0 .../roblox_string_escapes.fixed.diff | 0 .../deprecated/deprecated_fields.fixed.diff | 3 -- .../deprecated/specific_allow.fixed.diff | 7 --- .../toml_forwards_compatibility.fixed.diff | 2 - .../divide_by_zero/divide_by_zero.fixed.diff | 0 .../duplicate_keys/duplicate_keys.fixed.diff | 0 .../duplicate_keys/number_indices.fixed.diff | 0 .../tests/lints/empty_if/empty_if.fixed.diff | 0 .../empty_if/empty_if_comments.fixed.diff | 0 .../tests/lints/empty_loop/empty_loop.stderr | 18 ++++++++ .../empty_loop/empty_loop_comments.stderr | 14 ++++++ .../global_usage/global_usage.fixed.diff | 0 .../global_usage_ignore.fixed.diff | 0 .../complex_var_expressions.fixed.diff | 0 .../high_cyclomatic_complexity.fixed.diff | 0 .../lua51_basic_complexity.fixed.diff | 0 .../if_same_then_else.fixed.diff | 0 .../ifs_same_cond/ifs_same_cond.fixed.diff | 0 .../false_positive.fixed.diff | 0 .../manual_table_clone.fixed.diff | 0 ...alternative_function_definition.fixed.diff | 0 .../call_side_effects.fixed.diff | 0 .../definition_location.fixed.diff | 0 .../mismatched_arg_count.fixed.diff | 0 .../multiple_definition_locations.fixed.diff | 0 .../reassigned_variables.fixed.diff | 0 .../reassigned_variables_2.fixed.diff | 0 .../shadowing_variables.fixed.diff | 0 .../variable_function_def.fixed.diff | 0 .../lints/mixed_table/mixed_table.fixed.diff | 0 .../multiple_statements.fixed.diff | 0 .../one_line_if_allow.fixed.diff | 0 .../one_line_if_break_return_only.fixed.diff | 0 .../one_line_if_deny.fixed.diff | 0 .../tests/lints/must_use/must_use.fixed.diff | 0 .../parenthese_conditions.stderr | 16 +++++++ ...lox_incorrect_color3_new_bounds.fixed.diff | 0 .../mixed_roact_react_usage.fixed.diff | 0 .../old_roblox_std.fixed.diff | 1 - .../roblox_incorrect_react_usage.fixed.diff | 0 .../roblox_incorrect_roact_usage.fixed.diff | 0 .../roblox_suspicious_udim2_new.fixed.diff | 0 .../lints/shadowing/empty_else.fixed.diff | 0 .../lints/shadowing/shadowing.fixed.diff | 0 .../lints/standard_library/any.fixed.diff | 6 --- .../lints/standard_library/assert.fixed.diff | 9 ---- .../bad_call_signatures.fixed.diff | 20 -------- .../callable_metatables.fixed.diff | 2 - .../lints/standard_library/complex.fixed.diff | 3 -- .../standard_library/constants.fixed.diff | 9 ---- .../if_expressions.fixed.diff | 5 -- .../lints/standard_library/lua52.fixed.diff | 2 - .../standard_library/math_on_types.fixed.diff | 2 - .../standard_library/method_call.fixed.diff | 4 -- .../standard_library/required.fixed.diff | 11 ----- .../standard_library/shadowing.fixed.diff | 11 ----- .../string_interpolation.fixed.diff | 7 --- .../lints/standard_library/ternary.fixed.diff | 3 -- .../unknown_property.fixed.diff | 9 ---- .../unpack_function_arguments.fixed.diff | 12 ----- .../lints/standard_library/vararg.fixed.diff | 3 -- .../standard_library/wildcard.fixed.diff | 12 ----- .../wildcard_structs.fixed.diff | 6 --- .../lints/standard_library/writing.fixed.diff | 6 --- .../suspicious_reverse_loop.fixed.diff | 0 .../type_check_inside_call.fixed.diff | 0 .../unbalanced_assignments.fixed.diff | 0 .../lints/undefined_variable/basic.fixed.diff | 0 .../compound_assignments.fixed.diff | 0 .../function_overriding.fixed.diff | 0 .../undefined_variable/hoisting.fixed.diff | 0 .../lints/undefined_variable/self.fixed.diff | 0 .../undefined_variable/shadowing.fixed.diff | 0 .../string_interpolation.fixed.diff | 0 .../undefined_variable/varargs.fixed.diff | 0 .../function_overriding.fixed.diff | 0 .../unscoped_variables.fixed.diff | 0 .../function_overriding.fixed.diff | 1 - .../generic_for_shadowing.fixed.diff | 5 -- .../lints/unused_variable/ignore.fixed.diff | 1 - .../mutating_functions.fixed.diff | 3 -- .../lints/unused_variable/observes.fixed.diff | 46 ------------------- .../lints/unused_variable/self.fixed.diff | 6 --- .../unused_variable/self_ignored.fixed.diff | 5 -- .../unused_variable/shadowing.fixed.diff | 11 ----- .../unused_variable/write_only.fixed.diff | 17 ------- 90 files changed, 63 insertions(+), 270 deletions(-) create mode 100644 selene-lib/tests/lints/bad_string_escape/lua51_string_escapes.fixed.diff create mode 100644 selene-lib/tests/lints/bad_string_escape/roblox_string_escapes.fixed.diff create mode 100644 selene-lib/tests/lints/divide_by_zero/divide_by_zero.fixed.diff create mode 100644 selene-lib/tests/lints/duplicate_keys/duplicate_keys.fixed.diff create mode 100644 selene-lib/tests/lints/duplicate_keys/number_indices.fixed.diff create mode 100644 selene-lib/tests/lints/empty_if/empty_if.fixed.diff create mode 100644 selene-lib/tests/lints/empty_if/empty_if_comments.fixed.diff create mode 100644 selene-lib/tests/lints/global_usage/global_usage.fixed.diff create mode 100644 selene-lib/tests/lints/global_usage/global_usage_ignore.fixed.diff create mode 100644 selene-lib/tests/lints/high_cyclomatic_complexity/complex_var_expressions.fixed.diff create mode 100644 selene-lib/tests/lints/high_cyclomatic_complexity/high_cyclomatic_complexity.fixed.diff create mode 100644 selene-lib/tests/lints/high_cyclomatic_complexity/lua51_basic_complexity.fixed.diff create mode 100644 selene-lib/tests/lints/if_same_then_else/if_same_then_else.fixed.diff create mode 100644 selene-lib/tests/lints/ifs_same_cond/ifs_same_cond.fixed.diff create mode 100644 selene-lib/tests/lints/manual_table_clone/false_positive.fixed.diff create mode 100644 selene-lib/tests/lints/manual_table_clone/manual_table_clone.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/alternative_function_definition.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/call_side_effects.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/definition_location.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/mismatched_arg_count.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/multiple_definition_locations.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/reassigned_variables.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/reassigned_variables_2.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/shadowing_variables.fixed.diff create mode 100644 selene-lib/tests/lints/mismatched_arg_count/variable_function_def.fixed.diff create mode 100644 selene-lib/tests/lints/mixed_table/mixed_table.fixed.diff create mode 100644 selene-lib/tests/lints/multiple_statements/multiple_statements.fixed.diff create mode 100644 selene-lib/tests/lints/multiple_statements/one_line_if_allow.fixed.diff create mode 100644 selene-lib/tests/lints/multiple_statements/one_line_if_break_return_only.fixed.diff create mode 100644 selene-lib/tests/lints/multiple_statements/one_line_if_deny.fixed.diff create mode 100644 selene-lib/tests/lints/must_use/must_use.fixed.diff create mode 100644 selene-lib/tests/lints/roblox_incorrect_color3_new_bounds/roblox_incorrect_color3_new_bounds.fixed.diff create mode 100644 selene-lib/tests/lints/roblox_incorrect_roact_usage/mixed_roact_react_usage.fixed.diff create mode 100644 selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_react_usage.fixed.diff create mode 100644 selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_roact_usage.fixed.diff create mode 100644 selene-lib/tests/lints/roblox_suspicious_udim2_new/roblox_suspicious_udim2_new.fixed.diff create mode 100644 selene-lib/tests/lints/shadowing/empty_else.fixed.diff create mode 100644 selene-lib/tests/lints/shadowing/shadowing.fixed.diff create mode 100644 selene-lib/tests/lints/suspicious_reverse_loop/suspicious_reverse_loop.fixed.diff create mode 100644 selene-lib/tests/lints/type_check_inside_call/type_check_inside_call.fixed.diff create mode 100644 selene-lib/tests/lints/unbalanced_assignments/unbalanced_assignments.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/basic.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/compound_assignments.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/function_overriding.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/hoisting.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/self.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/shadowing.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/string_interpolation.fixed.diff create mode 100644 selene-lib/tests/lints/undefined_variable/varargs.fixed.diff create mode 100644 selene-lib/tests/lints/unscoped_variables/function_overriding.fixed.diff create mode 100644 selene-lib/tests/lints/unscoped_variables/unscoped_variables.fixed.diff diff --git a/selene-lib/src/lints/test_util.rs b/selene-lib/src/lints/test_util.rs index 0000da1b..7a218994 100644 --- a/selene-lib/src/lints/test_util.rs +++ b/selene-lib/src/lints/test_util.rs @@ -92,19 +92,31 @@ fn apply_diagnostics_fixes(code: &str, diagnostics: &[&Diagnostic]) -> String { new_code } +/// Returns empty string if there are no diffs fn generate_diff(source1: &str, source2: &str) -> String { let mut result = String::new(); + let mut has_changes = false; for change in TextDiff::from_lines(source1, source2).iter_all_changes() { let sign = match change.tag() { - ChangeTag::Delete => "-", - ChangeTag::Insert => "+", + ChangeTag::Delete => { + has_changes = true; + "-" + } + ChangeTag::Insert => { + has_changes = true; + "+" + } ChangeTag::Equal => " ", }; result.push_str(&format!("{}{}", sign, change.value())); } - result + if has_changes { + result + } else { + "".to_string() + } } pub fn test_lint_config_with_output< diff --git a/selene-lib/tests/lints/almost_swapped/almost_swapped.fixed.diff b/selene-lib/tests/lints/almost_swapped/almost_swapped.fixed.diff index fb054179..e69de29b 100644 --- a/selene-lib/tests/lints/almost_swapped/almost_swapped.fixed.diff +++ b/selene-lib/tests/lints/almost_swapped/almost_swapped.fixed.diff @@ -1,16 +0,0 @@ - x, y = y, x - - a = b - b = a - - t[1], t[2] = t[2], t[1] - - t[1] = t[2] - t[2] = t[1] - - foo().a = foo().b - foo().b = foo().a - - -- We use a weird hack so this comment might break something, oh no! - a = b - b = a diff --git a/selene-lib/tests/lints/almost_swapped/panic.fixed.diff b/selene-lib/tests/lints/almost_swapped/panic.fixed.diff index 1c06c479..e69de29b 100644 --- a/selene-lib/tests/lints/almost_swapped/panic.fixed.diff +++ b/selene-lib/tests/lints/almost_swapped/panic.fixed.diff @@ -1 +0,0 @@ - foo = "bar" \ No newline at end of file diff --git a/selene-lib/tests/lints/bad_string_escape/lua51_string_escapes.fixed.diff b/selene-lib/tests/lints/bad_string_escape/lua51_string_escapes.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/bad_string_escape/roblox_string_escapes.fixed.diff b/selene-lib/tests/lints/bad_string_escape/roblox_string_escapes.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/deprecated/deprecated_fields.fixed.diff b/selene-lib/tests/lints/deprecated/deprecated_fields.fixed.diff index 17b208a5..e69de29b 100644 --- a/selene-lib/tests/lints/deprecated/deprecated_fields.fixed.diff +++ b/selene-lib/tests/lints/deprecated/deprecated_fields.fixed.diff @@ -1,3 +0,0 @@ - local _ = this.is_deprecated - local _ = all_of_this.is_deprecated - local _ = all_of_this.even.deeper.is_deprecated diff --git a/selene-lib/tests/lints/deprecated/specific_allow.fixed.diff b/selene-lib/tests/lints/deprecated/specific_allow.fixed.diff index e25f2dd2..e69de29b 100644 --- a/selene-lib/tests/lints/deprecated/specific_allow.fixed.diff +++ b/selene-lib/tests/lints/deprecated/specific_allow.fixed.diff @@ -1,7 +0,0 @@ - deprecated_allowed() - deprecated_blocked() - - more.deprecated_allowed() - wow.extra.deprecated_allowed() - - deprecated_allowed.more() diff --git a/selene-lib/tests/lints/deprecated/toml_forwards_compatibility.fixed.diff b/selene-lib/tests/lints/deprecated/toml_forwards_compatibility.fixed.diff index 5b08ed21..e69de29b 100644 --- a/selene-lib/tests/lints/deprecated/toml_forwards_compatibility.fixed.diff +++ b/selene-lib/tests/lints/deprecated/toml_forwards_compatibility.fixed.diff @@ -1,2 +0,0 @@ - -- Tests that the old TOML format is unchanged - print(this_is.deprecated) diff --git a/selene-lib/tests/lints/divide_by_zero/divide_by_zero.fixed.diff b/selene-lib/tests/lints/divide_by_zero/divide_by_zero.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/duplicate_keys/duplicate_keys.fixed.diff b/selene-lib/tests/lints/duplicate_keys/duplicate_keys.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/duplicate_keys/number_indices.fixed.diff b/selene-lib/tests/lints/duplicate_keys/number_indices.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/empty_if/empty_if.fixed.diff b/selene-lib/tests/lints/empty_if/empty_if.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/empty_if/empty_if_comments.fixed.diff b/selene-lib/tests/lints/empty_if/empty_if_comments.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/empty_loop/empty_loop.stderr b/selene-lib/tests/lints/empty_loop/empty_loop.stderr index de0edc12..183daa8f 100644 --- a/selene-lib/tests/lints/empty_loop/empty_loop.stderr +++ b/selene-lib/tests/lints/empty_loop/empty_loop.stderr @@ -5,6 +5,8 @@ error[empty_loop]: empty loop block 10 │ │ -- Should warn 11 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:13:1 @@ -15,6 +17,8 @@ error[empty_loop]: empty loop block 16 │ │ ]] 17 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:19:1 @@ -25,6 +29,8 @@ error[empty_loop]: empty loop block 22 │ │ 23 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:29:1 @@ -32,6 +38,8 @@ error[empty_loop]: empty loop block 29 │ ╭ for _ in pairs({}) do 30 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:36:1 @@ -39,6 +47,8 @@ error[empty_loop]: empty loop block 36 │ ╭ for _ in ipairs({}) do 37 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:43:1 @@ -46,6 +56,8 @@ error[empty_loop]: empty loop block 43 │ ╭ for _ in {} do 44 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:50:1 @@ -53,6 +65,8 @@ error[empty_loop]: empty loop block 50 │ ╭ for _ in a() do 51 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:57:1 @@ -60,6 +74,8 @@ error[empty_loop]: empty loop block 57 │ ╭ while true do 58 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop.lua:64:1 @@ -67,4 +83,6 @@ error[empty_loop]: empty loop block 64 │ ╭ repeat 65 │ │ until true │ ╰──────────^ + │ + = try: `` diff --git a/selene-lib/tests/lints/empty_loop/empty_loop_comments.stderr b/selene-lib/tests/lints/empty_loop/empty_loop_comments.stderr index 9128ae0f..405eda83 100644 --- a/selene-lib/tests/lints/empty_loop/empty_loop_comments.stderr +++ b/selene-lib/tests/lints/empty_loop/empty_loop_comments.stderr @@ -7,6 +7,8 @@ error[empty_loop]: empty loop block 22 │ │ 23 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:29:1 @@ -14,6 +16,8 @@ error[empty_loop]: empty loop block 29 │ ╭ for _ in pairs({}) do 30 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:36:1 @@ -21,6 +25,8 @@ error[empty_loop]: empty loop block 36 │ ╭ for _ in ipairs({}) do 37 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:43:1 @@ -28,6 +34,8 @@ error[empty_loop]: empty loop block 43 │ ╭ for _ in {} do 44 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:50:1 @@ -35,6 +43,8 @@ error[empty_loop]: empty loop block 50 │ ╭ for _ in a() do 51 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:57:1 @@ -42,6 +52,8 @@ error[empty_loop]: empty loop block 57 │ ╭ while true do 58 │ │ end │ ╰───^ + │ + = try: `` error[empty_loop]: empty loop block ┌─ empty_loop_comments.lua:64:1 @@ -49,4 +61,6 @@ error[empty_loop]: empty loop block 64 │ ╭ repeat 65 │ │ until true │ ╰──────────^ + │ + = try: `` diff --git a/selene-lib/tests/lints/global_usage/global_usage.fixed.diff b/selene-lib/tests/lints/global_usage/global_usage.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/global_usage/global_usage_ignore.fixed.diff b/selene-lib/tests/lints/global_usage/global_usage_ignore.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/high_cyclomatic_complexity/complex_var_expressions.fixed.diff b/selene-lib/tests/lints/high_cyclomatic_complexity/complex_var_expressions.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/high_cyclomatic_complexity/high_cyclomatic_complexity.fixed.diff b/selene-lib/tests/lints/high_cyclomatic_complexity/high_cyclomatic_complexity.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/high_cyclomatic_complexity/lua51_basic_complexity.fixed.diff b/selene-lib/tests/lints/high_cyclomatic_complexity/lua51_basic_complexity.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/if_same_then_else/if_same_then_else.fixed.diff b/selene-lib/tests/lints/if_same_then_else/if_same_then_else.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/ifs_same_cond/ifs_same_cond.fixed.diff b/selene-lib/tests/lints/ifs_same_cond/ifs_same_cond.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/manual_table_clone/false_positive.fixed.diff b/selene-lib/tests/lints/manual_table_clone/false_positive.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/manual_table_clone/manual_table_clone.fixed.diff b/selene-lib/tests/lints/manual_table_clone/manual_table_clone.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/alternative_function_definition.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/alternative_function_definition.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/call_side_effects.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/call_side_effects.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/definition_location.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/definition_location.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/mismatched_arg_count.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/mismatched_arg_count.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/multiple_definition_locations.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/multiple_definition_locations.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/reassigned_variables.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/reassigned_variables.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/reassigned_variables_2.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/reassigned_variables_2.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/shadowing_variables.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/shadowing_variables.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mismatched_arg_count/variable_function_def.fixed.diff b/selene-lib/tests/lints/mismatched_arg_count/variable_function_def.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/mixed_table/mixed_table.fixed.diff b/selene-lib/tests/lints/mixed_table/mixed_table.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/multiple_statements/multiple_statements.fixed.diff b/selene-lib/tests/lints/multiple_statements/multiple_statements.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/multiple_statements/one_line_if_allow.fixed.diff b/selene-lib/tests/lints/multiple_statements/one_line_if_allow.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/multiple_statements/one_line_if_break_return_only.fixed.diff b/selene-lib/tests/lints/multiple_statements/one_line_if_break_return_only.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/multiple_statements/one_line_if_deny.fixed.diff b/selene-lib/tests/lints/multiple_statements/one_line_if_deny.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/must_use/must_use.fixed.diff b/selene-lib/tests/lints/must_use/must_use.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/parenthese_conditions/parenthese_conditions.stderr b/selene-lib/tests/lints/parenthese_conditions/parenthese_conditions.stderr index 74913130..f42e84f6 100644 --- a/selene-lib/tests/lints/parenthese_conditions/parenthese_conditions.stderr +++ b/selene-lib/tests/lints/parenthese_conditions/parenthese_conditions.stderr @@ -3,30 +3,40 @@ error[parenthese_conditions]: lua does not require parentheses around conditions │ 2 │ if (x) then end │ ^^^ + │ + = try: `x` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:4:4 │ 4 │ if (x) then │ ^^^ + │ + = try: `x` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:6:8 │ 6 │ elseif (z) then │ ^^^ + │ + = try: `z` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:10:7 │ 10 │ while (true) do end │ ^^^^^^ + │ + = try: `true` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:13:14 │ 13 │ repeat until (false) │ ^^^^^^^ + │ + = try: `false` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:17:4 @@ -36,10 +46,16 @@ error[parenthese_conditions]: lua does not require parentheses around conditions 18 │ │ if (x) then end 19 │ │ end)()) then end │ ╰───────^ + │ + = try: `(function() + if (x) then end + end)()` error[parenthese_conditions]: lua does not require parentheses around conditions ┌─ parenthese_conditions.lua:18:8 │ 18 │ if (x) then end │ ^^^ + │ + = try: `x` diff --git a/selene-lib/tests/lints/roblox_incorrect_color3_new_bounds/roblox_incorrect_color3_new_bounds.fixed.diff b/selene-lib/tests/lints/roblox_incorrect_color3_new_bounds/roblox_incorrect_color3_new_bounds.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/roblox_incorrect_roact_usage/mixed_roact_react_usage.fixed.diff b/selene-lib/tests/lints/roblox_incorrect_roact_usage/mixed_roact_react_usage.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/roblox_incorrect_roact_usage/old_roblox_std.fixed.diff b/selene-lib/tests/lints/roblox_incorrect_roact_usage/old_roblox_std.fixed.diff index 58f63e35..e69de29b 100644 --- a/selene-lib/tests/lints/roblox_incorrect_roact_usage/old_roblox_std.fixed.diff +++ b/selene-lib/tests/lints/roblox_incorrect_roact_usage/old_roblox_std.fixed.diff @@ -1 +0,0 @@ - Roact.createElement("Frame") diff --git a/selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_react_usage.fixed.diff b/selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_react_usage.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_roact_usage.fixed.diff b/selene-lib/tests/lints/roblox_incorrect_roact_usage/roblox_incorrect_roact_usage.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/roblox_suspicious_udim2_new/roblox_suspicious_udim2_new.fixed.diff b/selene-lib/tests/lints/roblox_suspicious_udim2_new/roblox_suspicious_udim2_new.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/shadowing/empty_else.fixed.diff b/selene-lib/tests/lints/shadowing/empty_else.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/shadowing/shadowing.fixed.diff b/selene-lib/tests/lints/shadowing/shadowing.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/standard_library/any.fixed.diff b/selene-lib/tests/lints/standard_library/any.fixed.diff index 06562162..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/any.fixed.diff +++ b/selene-lib/tests/lints/standard_library/any.fixed.diff @@ -1,6 +0,0 @@ - print(foo) - print(foo.x) - print(foo.x.y.z) - print(foo:x()) - foo.x = 1 - foo.x.y = 2 diff --git a/selene-lib/tests/lints/standard_library/assert.fixed.diff b/selene-lib/tests/lints/standard_library/assert.fixed.diff index fbbdbff8..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/assert.fixed.diff +++ b/selene-lib/tests/lints/standard_library/assert.fixed.diff @@ -1,9 +0,0 @@ - assert(true, "message") - assert(call()) - assert(call(), "this is ok") - assert(...) - - assert(true) - assert(true, "message", call()) - assert(true, "message", ...) - assert() diff --git a/selene-lib/tests/lints/standard_library/bad_call_signatures.fixed.diff b/selene-lib/tests/lints/standard_library/bad_call_signatures.fixed.diff index 54b6bf98..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/bad_call_signatures.fixed.diff +++ b/selene-lib/tests/lints/standard_library/bad_call_signatures.fixed.diff @@ -1,20 +0,0 @@ - print() - print("a", 2, "c") - math.sin(3) - math.sin(1 + 1) - math.random() - math.random(1) - print "hello" - -- - math.sin("i'd like the sine of three, please") - math.floor(3.5, "remember to make sure it's 3 :)") - math.sin "pi" - -- - local variable = 3 - math.sin(variable) - math.sin(variable, variable) - -- - math.max(2) - math.pi() - string.format(-2, "foo") - string.format(1 + 1) diff --git a/selene-lib/tests/lints/standard_library/callable_metatables.fixed.diff b/selene-lib/tests/lints/standard_library/callable_metatables.fixed.diff index 5e87e357..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/callable_metatables.fixed.diff +++ b/selene-lib/tests/lints/standard_library/callable_metatables.fixed.diff @@ -1,2 +0,0 @@ - expect.extend({}) - expect(1).to.be.ok() diff --git a/selene-lib/tests/lints/standard_library/complex.fixed.diff b/selene-lib/tests/lints/standard_library/complex.fixed.diff index 061e23c9..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/complex.fixed.diff +++ b/selene-lib/tests/lints/standard_library/complex.fixed.diff @@ -1,3 +0,0 @@ - print(require("foo").bar) - print(coroutine.wrap(print)()) - getmetatable({}).__index = function() end diff --git a/selene-lib/tests/lints/standard_library/constants.fixed.diff b/selene-lib/tests/lints/standard_library/constants.fixed.diff index 1c730fc6..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/constants.fixed.diff +++ b/selene-lib/tests/lints/standard_library/constants.fixed.diff @@ -1,9 +0,0 @@ - collectgarbage("count") - collectgarbage "count" - - collectgarbage("doge") - collectgarbage(1) - - collectgarbage("coun" .. "t") - - collectgarbage() diff --git a/selene-lib/tests/lints/standard_library/if_expressions.fixed.diff b/selene-lib/tests/lints/standard_library/if_expressions.fixed.diff index 7a9eed3d..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/if_expressions.fixed.diff +++ b/selene-lib/tests/lints/standard_library/if_expressions.fixed.diff @@ -1,5 +0,0 @@ - math.floor(if x then 1 else 2) - math.floor(if x then "a" else "b") - - -- TODO: Let's try to capture this, right now the entire expression just resolves to no type - math.floor(if x then 1 else "a") diff --git a/selene-lib/tests/lints/standard_library/lua52.fixed.diff b/selene-lib/tests/lints/standard_library/lua52.fixed.diff index c48a08c3..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/lua52.fixed.diff +++ b/selene-lib/tests/lints/standard_library/lua52.fixed.diff @@ -1,2 +0,0 @@ - table.unpack({}) - setfenv() -- This would error if it was defined, since setfenv requires an argument diff --git a/selene-lib/tests/lints/standard_library/math_on_types.fixed.diff b/selene-lib/tests/lints/standard_library/math_on_types.fixed.diff index e64677c8..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/math_on_types.fixed.diff +++ b/selene-lib/tests/lints/standard_library/math_on_types.fixed.diff @@ -1,2 +0,0 @@ - usesType(x * 0.5) - usesType(0.5 * x) diff --git a/selene-lib/tests/lints/standard_library/method_call.fixed.diff b/selene-lib/tests/lints/standard_library/method_call.fixed.diff index 3612cd65..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/method_call.fixed.diff +++ b/selene-lib/tests/lints/standard_library/method_call.fixed.diff @@ -1,4 +0,0 @@ - foo:bar(1) - foo:bar("a") - foo.bar() - foo:baz() diff --git a/selene-lib/tests/lints/standard_library/required.fixed.diff b/selene-lib/tests/lints/standard_library/required.fixed.diff index b11db297..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/required.fixed.diff +++ b/selene-lib/tests/lints/standard_library/required.fixed.diff @@ -1,11 +0,0 @@ - -- ipairs requires an argument--this should fail. - ipairs() - - -- setmetatable requires a first argument, but not a second one. this should still fail. - setmetatable() - - -- This, however, should not. - setmetatable({}) - - -- nil counts as filling in an unrequired argument. - setmetatable({}, nil) diff --git a/selene-lib/tests/lints/standard_library/shadowing.fixed.diff b/selene-lib/tests/lints/standard_library/shadowing.fixed.diff index d8219f6c..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/shadowing.fixed.diff +++ b/selene-lib/tests/lints/standard_library/shadowing.fixed.diff @@ -1,11 +0,0 @@ - local math = {} - math.dog = 1 - math.sin = print - - math.sin("hi" + math.dog) - - function foo(table) - table.insert() - end - - table.insert() diff --git a/selene-lib/tests/lints/standard_library/string_interpolation.fixed.diff b/selene-lib/tests/lints/standard_library/string_interpolation.fixed.diff index 8e566826..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/string_interpolation.fixed.diff +++ b/selene-lib/tests/lints/standard_library/string_interpolation.fixed.diff @@ -1,7 +0,0 @@ - collectgarbage(`count`) - collectgarbage(`ohno`) - - string.upper(`foo`) - string.upper(`foo{"bar"}`) - - math.floor(`oh no`) diff --git a/selene-lib/tests/lints/standard_library/ternary.fixed.diff b/selene-lib/tests/lints/standard_library/ternary.fixed.diff index aec00402..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/ternary.fixed.diff +++ b/selene-lib/tests/lints/standard_library/ternary.fixed.diff @@ -1,3 +0,0 @@ - math.floor(r > 1 and 1 or 0) - math.floor(r > 1 + 1) - math.floor(not flag and 1 or 0) diff --git a/selene-lib/tests/lints/standard_library/unknown_property.fixed.diff b/selene-lib/tests/lints/standard_library/unknown_property.fixed.diff index 1e58a8ea..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/unknown_property.fixed.diff +++ b/selene-lib/tests/lints/standard_library/unknown_property.fixed.diff @@ -1,9 +0,0 @@ - print("3.14 = ", math.pie) - print(print.foo) - print(math.huge.big) - math.call() - - -- These aren't correct, but they should be covered under a different lint - call() - local _ = bad - print(foo.bar) diff --git a/selene-lib/tests/lints/standard_library/unpack_function_arguments.fixed.diff b/selene-lib/tests/lints/standard_library/unpack_function_arguments.fixed.diff index 1bbff94f..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/unpack_function_arguments.fixed.diff +++ b/selene-lib/tests/lints/standard_library/unpack_function_arguments.fixed.diff @@ -1,12 +0,0 @@ - -- Since functions can pass multiple parameters through a function if they're the last ones to be called, - -- selene needs to be able to recognize this and not error. - - -- This should not lint, since `unpack(stuff)` could pass in multiple parameters. - math.max(unpack(stuff)) - - -- This should lint, since functions only pass multiple parameters if they are the last argument. - -- debug.setlocal is used because it takes three required parameters. - debug.setlocal(unpack(stuff), 2) - - -- This is still wrong since it has too many parameters. - string.upper("text", unpack(stuff)) diff --git a/selene-lib/tests/lints/standard_library/vararg.fixed.diff b/selene-lib/tests/lints/standard_library/vararg.fixed.diff index c31aa369..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/vararg.fixed.diff +++ b/selene-lib/tests/lints/standard_library/vararg.fixed.diff @@ -1,3 +0,0 @@ - return function(...) - table.insert(...) - end diff --git a/selene-lib/tests/lints/standard_library/wildcard.fixed.diff b/selene-lib/tests/lints/standard_library/wildcard.fixed.diff index 5b5d9bc1..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/wildcard.fixed.diff +++ b/selene-lib/tests/lints/standard_library/wildcard.fixed.diff @@ -1,12 +0,0 @@ - script.ClassName = 3 - - script.Name = "Script" - script.Name.UhOh = "Oops" - - script.Child = "Oops" - script.Child.Name = "Okay" - - script.Child.Grandchild.Name = "Okay" - - print(x.y.z) - print(x.y.fail) diff --git a/selene-lib/tests/lints/standard_library/wildcard_structs.fixed.diff b/selene-lib/tests/lints/standard_library/wildcard_structs.fixed.diff index d56adb03..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/wildcard_structs.fixed.diff +++ b/selene-lib/tests/lints/standard_library/wildcard_structs.fixed.diff @@ -1,6 +0,0 @@ - script.Name = "Okay" - script.Child = "Oops" - script.Child.Name = "Okay" - script.Child.Name.UhOh = "Oops" - script.Child.Grandchild = "Oops" - script.Child.Grandchild.Name = "Okay" diff --git a/selene-lib/tests/lints/standard_library/writing.fixed.diff b/selene-lib/tests/lints/standard_library/writing.fixed.diff index 883e4744..e69de29b 100644 --- a/selene-lib/tests/lints/standard_library/writing.fixed.diff +++ b/selene-lib/tests/lints/standard_library/writing.fixed.diff @@ -1,6 +0,0 @@ - _G.foo = true - print(_G.foo) - _G = {} - - math.pi = 3 - math.foo = 4 diff --git a/selene-lib/tests/lints/suspicious_reverse_loop/suspicious_reverse_loop.fixed.diff b/selene-lib/tests/lints/suspicious_reverse_loop/suspicious_reverse_loop.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/type_check_inside_call/type_check_inside_call.fixed.diff b/selene-lib/tests/lints/type_check_inside_call/type_check_inside_call.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/unbalanced_assignments/unbalanced_assignments.fixed.diff b/selene-lib/tests/lints/unbalanced_assignments/unbalanced_assignments.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/basic.fixed.diff b/selene-lib/tests/lints/undefined_variable/basic.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/compound_assignments.fixed.diff b/selene-lib/tests/lints/undefined_variable/compound_assignments.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/function_overriding.fixed.diff b/selene-lib/tests/lints/undefined_variable/function_overriding.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/hoisting.fixed.diff b/selene-lib/tests/lints/undefined_variable/hoisting.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/self.fixed.diff b/selene-lib/tests/lints/undefined_variable/self.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/shadowing.fixed.diff b/selene-lib/tests/lints/undefined_variable/shadowing.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/string_interpolation.fixed.diff b/selene-lib/tests/lints/undefined_variable/string_interpolation.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/undefined_variable/varargs.fixed.diff b/selene-lib/tests/lints/undefined_variable/varargs.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/unscoped_variables/function_overriding.fixed.diff b/selene-lib/tests/lints/unscoped_variables/function_overriding.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/unscoped_variables/unscoped_variables.fixed.diff b/selene-lib/tests/lints/unscoped_variables/unscoped_variables.fixed.diff new file mode 100644 index 00000000..e69de29b diff --git a/selene-lib/tests/lints/unused_variable/function_overriding.fixed.diff b/selene-lib/tests/lints/unused_variable/function_overriding.fixed.diff index 2c506de0..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/function_overriding.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/function_overriding.fixed.diff @@ -1 +0,0 @@ - function global.name() end diff --git a/selene-lib/tests/lints/unused_variable/generic_for_shadowing.fixed.diff b/selene-lib/tests/lints/unused_variable/generic_for_shadowing.fixed.diff index 2c55b24a..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/generic_for_shadowing.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/generic_for_shadowing.fixed.diff @@ -1,5 +0,0 @@ - return function(foo, ...) - for _, foo in pairs({ foo, ... }) do - print(foo) - end - end diff --git a/selene-lib/tests/lints/unused_variable/ignore.fixed.diff b/selene-lib/tests/lints/unused_variable/ignore.fixed.diff index 48a8d5f2..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/ignore.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/ignore.fixed.diff @@ -1 +0,0 @@ - local _ = 0 diff --git a/selene-lib/tests/lints/unused_variable/mutating_functions.fixed.diff b/selene-lib/tests/lints/unused_variable/mutating_functions.fixed.diff index 80480088..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/mutating_functions.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/mutating_functions.fixed.diff @@ -1,3 +0,0 @@ - local noSideEffects = call() - - function noSideEffects.foo() end diff --git a/selene-lib/tests/lints/unused_variable/observes.fixed.diff b/selene-lib/tests/lints/unused_variable/observes.fixed.diff index e62cc6fa..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/observes.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/observes.fixed.diff @@ -1,46 +0,0 @@ - local writtenOnlyA = {} - table.insert(writtenOnlyA, 3) - - local readA = {} - print(table.insert(readA, 3)) - - -- Make sure doing it inside other statements doesn't trigger false negatives - print(function() - local writtenOnlyB = {} - table.insert(writtenOnlyB, 1) - - local readB = {} - return table.insert(readB, 1) - end) - - if true then - local writtenOnlyC = {} - table.insert(writtenOnlyC, 1) - - local readC = {} - print(table.insert(readC, 1)) - end - - local insertButReadLater = {} - table.insert(insertButReadLater, 1) - print(insertButReadLater) - - local ambiguous = external() - table.insert(ambiguous, 1) - - local rooms = { - boss = {}, - } - - for index, room in pairs(rooms) do - table.insert(room, 1) - - local roomByIndex = rooms[index] - table.insert(roomByIndex, 2) - end - - local nested = { - key = external(), - } - - table.insert(nested.key, 1) diff --git a/selene-lib/tests/lints/unused_variable/self.fixed.diff b/selene-lib/tests/lints/unused_variable/self.fixed.diff index 924d1a20..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/self.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/self.fixed.diff @@ -1,6 +0,0 @@ - local Foo = {} - - function Foo:A() end - function Foo.B() end - - return Foo diff --git a/selene-lib/tests/lints/unused_variable/self_ignored.fixed.diff b/selene-lib/tests/lints/unused_variable/self_ignored.fixed.diff index 3d05c3f4..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/self_ignored.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/self_ignored.fixed.diff @@ -1,5 +0,0 @@ - local Foo = {} - - function Foo:A() end - - return Foo diff --git a/selene-lib/tests/lints/unused_variable/shadowing.fixed.diff b/selene-lib/tests/lints/unused_variable/shadowing.fixed.diff index 32cf84b3..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/shadowing.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/shadowing.fixed.diff @@ -1,11 +0,0 @@ - local x = 0 - - repeat - x = x + wait() - until x >= 5 - - local x = 0 - - repeat - x = x + wait() - until x >= 5 diff --git a/selene-lib/tests/lints/unused_variable/write_only.fixed.diff b/selene-lib/tests/lints/unused_variable/write_only.fixed.diff index 47262952..e69de29b 100644 --- a/selene-lib/tests/lints/unused_variable/write_only.fixed.diff +++ b/selene-lib/tests/lints/unused_variable/write_only.fixed.diff @@ -1,17 +0,0 @@ - local bad1 = {} - bad1.x = 1 - bad1.y = 2 - bad1["z"] = 1 - - local badButNotYetImplemented = { x = {} } - badButNotYetImplemented.x.y = 1 - - local okay1 = ok() - okay1.x = 1 - okay1.y = 2 - - local okay2 = { x = ok() } - okay2.x.y = 1 - - local okay3 = {} - okay3.x().y = 1