-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize try message for code suggestion
- Loading branch information
1 parent
5a52738
commit c8d1919
Showing
33 changed files
with
255 additions
and
64 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
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
selene-lib/tests/lints/almost_swapped/almost_swapped.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
foo = "bar" |
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
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
20 changes: 20 additions & 0 deletions
20
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
print(x == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == x) | ||
|
||
-print(x == {}) | ||
-print({} == x) | ||
-print(x ~= {}) | ||
-print({} ~= x) | ||
+print(next(x) == nil) | ||
+print(next(x) == nil) | ||
+print(next(x) ~= nil) | ||
+print(next(x) ~= nil) | ||
|
||
print({ "a", "b", "c" } == { "a", "b", "c" }) | ||
print({ "a", "b", "c" } == {}) | ||
print({} == {}) | ||
|
||
print( -- my cool table | ||
- t == {} | ||
+ next(t) == nil | ||
) |
1 change: 1 addition & 0 deletions
1
selene-lib/tests/lints/roblox_incorrect_roact_usage/old_roblox_std.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Roact.createElement("Frame") |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
print(foo) | ||
print(foo.x) | ||
print(foo.x.y.z) | ||
print(foo:x()) | ||
foo.x = 1 | ||
foo.x.y = 2 |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
assert(true, "message") | ||
assert(call()) | ||
assert(call(), "this is ok") | ||
assert(...) | ||
|
||
assert(true) | ||
assert(true, "message", call()) | ||
assert(true, "message", ...) | ||
assert() |
20 changes: 20 additions & 0 deletions
20
selene-lib/tests/lints/standard_library/bad_call_signatures.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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) |
2 changes: 2 additions & 0 deletions
2
selene-lib/tests/lints/standard_library/callable_metatables.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
expect.extend({}) | ||
expect(1).to.be.ok() |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
print(require("foo").bar) | ||
print(coroutine.wrap(print)()) | ||
getmetatable({}).__index = function() end |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
collectgarbage("count") | ||
collectgarbage "count" | ||
|
||
collectgarbage("doge") | ||
collectgarbage(1) | ||
|
||
collectgarbage("coun" .. "t") | ||
|
||
collectgarbage() |
5 changes: 5 additions & 0 deletions
5
selene-lib/tests/lints/standard_library/if_expressions.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
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") |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
table.unpack({}) | ||
setfenv() -- This would error if it was defined, since setfenv requires an argument |
2 changes: 2 additions & 0 deletions
2
selene-lib/tests/lints/standard_library/math_on_types.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usesType(x * 0.5) | ||
usesType(0.5 * x) |
4 changes: 4 additions & 0 deletions
4
selene-lib/tests/lints/standard_library/method_call.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
foo:bar(1) | ||
foo:bar("a") | ||
foo.bar() | ||
foo:baz() |
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
11 changes: 11 additions & 0 deletions
11
selene-lib/tests/lints/standard_library/required.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- 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) |
Oops, something went wrong.