-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2bc397
commit 935dfbb
Showing
16 changed files
with
383 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 34 additions & 34 deletions
68
selene-lib/tests/lints/compare_nan/compare_nan_if.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
-MI if x == 0/0 then | ||
+MI if x ~= x then | ||
end | ||
|
||
-MI if x ~= 0/0 then | ||
+MI if x == x then | ||
end | ||
|
||
if x ~= x then | ||
end | ||
|
||
if x >= 0/0 then | ||
end | ||
|
||
if 1 == 0/0 then | ||
end | ||
|
||
if 1 ~= 0/0 then | ||
end | ||
|
||
if 1 + 0/0 then | ||
end | ||
|
||
if y.foo() == 0/0 then | ||
end | ||
|
||
if y.bar() ~= 0/0 then | ||
end | ||
|
||
if x == 1 then | ||
end | ||
|
||
if 1 == 0 then | ||
end | ||
-[MI] if x == 0/0 then | ||
+[MI] if x ~= x then | ||
end | ||
-[MI] if x ~= 0/0 then | ||
+[MI] if x == x then | ||
end | ||
if x ~= x then | ||
end | ||
if x >= 0/0 then | ||
end | ||
if 1 == 0/0 then | ||
end | ||
if 1 ~= 0/0 then | ||
end | ||
if 1 + 0/0 then | ||
end | ||
if y.foo() == 0/0 then | ||
end | ||
if y.bar() ~= 0/0 then | ||
end | ||
if x == 1 then | ||
end | ||
if 1 == 0 then | ||
end |
30 changes: 15 additions & 15 deletions
30
selene-lib/tests/lints/compare_nan/compare_nan_variables.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
local _ = 0/0 | ||
local _ = 1 ~= 0/0 | ||
local _ = 2 == 0/0 | ||
local _ = 3 + 0/0 | ||
local _ = 4 >= 0/0 | ||
-MI local _ = x ~= 0/0 | ||
-MI local _ = x == 0/0 | ||
+MI local _ = x == x | ||
+MI local _ = x ~= x | ||
local _ = x >= 0/0 | ||
local _ = y.foo() == 0/0 | ||
local _ = y.bar() ~= 0/0 | ||
|
||
local _ = x == 1 | ||
local _ = 1 == 0 | ||
local _ = 0/0 | ||
local _ = 1 ~= 0/0 | ||
local _ = 2 == 0/0 | ||
local _ = 3 + 0/0 | ||
local _ = 4 >= 0/0 | ||
-[MI] local _ = x ~= 0/0 | ||
-[MI] local _ = x == 0/0 | ||
+[MI] local _ = x == x | ||
+[MI] local _ = x ~= x | ||
local _ = x >= 0/0 | ||
local _ = y.foo() == 0/0 | ||
local _ = y.bar() ~= 0/0 | ||
local _ = x == 1 | ||
local _ = 1 == 0 |
40 changes: 20 additions & 20 deletions
40
selene-lib/tests/lints/constant_table_comparison/constant_table_comparison.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
print(x == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == x) | ||
|
||
-MI print(x == {}) | ||
-MI print({} == x) | ||
-MI print(x ~= {}) | ||
-MI print({} ~= x) | ||
+MI print(next(x) == nil) | ||
+MI print(next(x) == nil) | ||
+MI print(next(x) ~= nil) | ||
+MI print(next(x) ~= nil) | ||
|
||
print({ "a", "b", "c" } == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == {}) | ||
print({} == {}) | ||
|
||
print( -- my cool table | ||
-MI t == {} | ||
+MI next(t) == nil | ||
) | ||
print(x == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == x) | ||
-[MI] print(x == {}) | ||
-[MI] print({} == x) | ||
-[MI] print(x ~= {}) | ||
-[MI] print({} ~= x) | ||
+[MI] print(next(x) == nil) | ||
+[MI] print(next(x) == nil) | ||
+[MI] print(next(x) ~= nil) | ||
+[MI] print(next(x) ~= nil) | ||
print({ "a", "b", "c" } == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == {}) | ||
print({} == {}) | ||
print( -- my cool table | ||
-[MI] t == {} | ||
+[MI] next(t) == nil | ||
) |
10 changes: 5 additions & 5 deletions
10
selene-lib/tests/lints/deprecated/deprecated_functions.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
table.foreach({}, function(k, v) end) | ||
-MA print(table.getn(x)) | ||
+MA print(#x) | ||
|
||
table.foreach({}, 3) | ||
table.foreach({}, function(k, v) end) | ||
-[MA] print(table.getn(x)) | ||
+[MA] print(#x) | ||
table.foreach({}, 3) |
146 changes: 73 additions & 73 deletions
146
selene-lib/tests/lints/empty_loop/empty_loop.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,73 @@ | ||
for _ = 1, 10 do | ||
return "Should not warn" | ||
end | ||
|
||
for _ = 1, 10 do | ||
print("Should not warn") | ||
end | ||
|
||
-MI for _ = 1, 10 do | ||
-MI -- Should warn | ||
-MI end | ||
|
||
-MI for _ = 1, 10 do | ||
-MI --[[ | ||
-MI Should warn | ||
-MI ]] | ||
-MI end | ||
|
||
-MI for _ = 1, 10 do | ||
|
||
|
||
-MI | ||
-MI end | ||
|
||
+ | ||
for _ in pairs({}) do | ||
return "Should not warn" | ||
end | ||
|
||
-MI for _ in pairs({}) do | ||
-MI end | ||
|
||
+ | ||
for _ in ipairs({}) do | ||
return "Should not warn" | ||
end | ||
|
||
-MI for _ in ipairs({}) do | ||
-MI end | ||
|
||
+ | ||
for _ in {} do | ||
return "Should not warn" | ||
end | ||
|
||
-MI for _ in {} do | ||
-MI end | ||
|
||
+ | ||
for _ in a() do | ||
return "Should not warn" | ||
end | ||
|
||
-MI for _ in a() do | ||
-MI end | ||
|
||
+ | ||
while true do | ||
return "Should not warn" | ||
end | ||
|
||
-MI while true do | ||
-MI end | ||
|
||
+ | ||
repeat | ||
return "Should not warn" | ||
until true | ||
|
||
-MI repeat | ||
-MI until true | ||
+MI | ||
-- comment here shouldn't break anything | ||
for _ = 1, 10 do | ||
return "Should not warn" | ||
end | ||
for _ = 1, 10 do | ||
print("Should not warn") | ||
end | ||
-[MI] for _ = 1, 10 do | ||
-[MI] -- Should warn | ||
-[MI] end | ||
-[MI] for _ = 1, 10 do | ||
-[MI] --[[ | ||
-[MI] Should warn | ||
-[MI] ]] | ||
-[MI] end | ||
-[MI] for _ = 1, 10 do | ||
-[MI] | ||
-[MI] end | ||
+ | ||
for _ in pairs({}) do | ||
return "Should not warn" | ||
end | ||
-[MI] for _ in pairs({}) do | ||
-[MI] end | ||
+ | ||
for _ in ipairs({}) do | ||
return "Should not warn" | ||
end | ||
-[MI] for _ in ipairs({}) do | ||
-[MI] end | ||
+ | ||
for _ in {} do | ||
return "Should not warn" | ||
end | ||
-[MI] for _ in {} do | ||
-[MI] end | ||
+ | ||
for _ in a() do | ||
return "Should not warn" | ||
end | ||
-[MI] for _ in a() do | ||
-[MI] end | ||
+ | ||
while true do | ||
return "Should not warn" | ||
end | ||
-[MI] while true do | ||
-[MI] end | ||
+ | ||
repeat | ||
return "Should not warn" | ||
until true | ||
-[MI] repeat | ||
-[MI] until true | ||
+[MI] | ||
-- comment here shouldn't break anything |
Oops, something went wrong.