-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model call chains as an AbstractTokenTarget
#443
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
bcb8faf
wip
reese 850216c
This mostly works!
reese 285abc6
wip
reese b55a612
Fix line length checking for call chain breakables
reese f20426f
Squash some more bugs
reese 744e817
Fix line winding in calls
reese 7f0e36c
Fix indentation in nested breakables inside call chains
reese ad42bcf
Assertion fix
reese cff3121
wip
reese 5be646b
its alive!
reese a2fa7d4
It's _even more alive_
reese 4cb900c
Fix really long single-dot methods being multilined
reese c50e057
Get begin/end stuff working
reese 09a6d8b
Fix nested heredocs
reese 1937de0
Fix extra whitespace on empty lines
reese 1c1862a
Fix heredocs in call chains
reese 4fbb2f8
[might delete] try removing my dumb hack
reese 1f08e20
Take another crack at user-multilining
reese 96fa67b
Fix weird line reporting for ArgsAddStar...
reese 9a39f02
Break on call chains before breaking on inner breakables
reese 087a994
Fix precedence
reese 5653f0f
Fix line length check for call chain breakables
reese dba5aa9
Fix call chains with heredocs embedded in string embedded expressions
reese 86983b6
Reintroduce explicitly single-lining Class.call patterns
reese 825d527
Don't force
reese a535184
Include leading indentation when calculating bcce line length
reese b6e42e9
Fix issue with calls in ternaries in embedded expressions
reese bbb93ba
Fix double quote length
reese 793cf8b
Fix aref line winding
reese 75adc46
Single-line single calls
reese b856ef0
Fix start_line for parens
reese a379f3c
Finish todos
reese d47eb4b
Fix method add args wrapped in parens
reese 9b3e904
Fix comments in methods with visibility modifiers
reese 98d309c
Don't unnecessariliy render expressions in mulitline checking
reese 07aa735
Try simplifying call chain logic
reese 73ecc12
Experiment with new line length checking
reese f56be0f
Support other user-multilined const expressions
reese d186036
Fix rendering for const path refs
reese 45fef70
Fix issues with inlined methods and comments
reese 481bf4c
Make conditional modifiers multiline if anything in the conditional i…
reese 73602c8
Fix comment winding for brace blocks
reese cbc4c2b
Fix paren line winding
reese 0898db8
Skip empty lines in indented heredocs
reese 64d273a
Fix paren expressions with method add args
reese b47c0cb
Roll back a bunch of unneeded changes
reese c905b0b
Fix fixture
reese b4b17eb
Use trait methods instead
reese 55056f7
Fix lint errors
reese e64fc0e
Actually fix the heredoc whitespace thing this time
reese 7e344a2
Cleanup and some additional commenting
reese 6d6d246
Remove some dead code
reese 3b16c86
Use peekable
reese 9452b63
Use Option instead of making calls unreachable
reese abb45af
Only clone needed expression when rendering visibility modifers
reese 7052661
Add comment on not shifting comments in block call chain elements
reese 791ed66
Make next_args_list_must_use_parens a bit cleaner
reese a2bb4e2
Make HeredocStart an actual concrete token
reese 6bc8a3a
Use delims for empty method call parens
reese 24f4b27
Add some tests for call chains with different comment placements
reese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
a = begin | ||
end | ||
end | ||
|
||
begin | ||
end | ||
.freeze |
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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
a = begin | ||
end | ||
end | ||
|
||
begin | ||
end.freeze |
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,3 +1,12 @@ | ||
def func | ||
brace_block_with_no_args { p 'hi' } | ||
end | ||
|
||
{ | ||
"/v1/transfers" => lambda { | ||
foo | ||
bar | ||
# TODO: add baz here | ||
# Oh and maybe quux if you have time | ||
} | ||
} |
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,3 +1,12 @@ | ||
def func | ||
brace_block_with_no_args { p("hi") } | ||
end | ||
|
||
{ | ||
"/v1/transfers" => lambda { | ||
foo | ||
bar | ||
# TODO: add baz here | ||
# Oh and maybe quux if you have time | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,3 +7,7 @@ def foo | |
puts("hi") | ||
end | ||
end | ||
|
||
do_stuff! if it_isnt_dangerous( | ||
i_promise: true | ||
) |
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 |
---|---|---|
|
@@ -7,3 +7,9 @@ def foo | |
puts("hi") | ||
end | ||
end | ||
|
||
if it_isnt_dangerous( | ||
i_promise: true | ||
) | ||
do_stuff! | ||
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
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
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,7 +1,8 @@ | ||
sig { | ||
params( | ||
route: String | ||
).void | ||
) | ||
.void | ||
} | ||
def ajax_get(route) | ||
super | ||
|
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ def blorp | |
method_call( | ||
arg_a, | ||
arg_b | ||
).chained_call | ||
) | ||
.chained_call | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
a (1) | ||
other_cool_method (a + b).round(4) | ||
|
||
# rubocop:disable PrisonGuard/PrivateModule | ||
(foo( | ||
foo # rubocop:enable PrisonGuard/PrivateModule | ||
)).flatten | ||
|
||
# rubocop:disable Style/Stuff | ||
(MyModel::InSomeNamespace | ||
.load_one( | ||
# rubocop:enable Style/Stuff | ||
{name: "name"} | ||
) | ||
&.rules) | ||
.freeze |
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,2 +1,18 @@ | ||
a(1) | ||
other_cool_method((a + b).round(4)) | ||
|
||
# rubocop:disable PrisonGuard/PrivateModule | ||
(foo( | ||
# rubocop:enable PrisonGuard/PrivateModule | ||
foo | ||
)) | ||
.flatten | ||
|
||
# rubocop:disable Style/Stuff | ||
(MyModel::InSomeNamespace | ||
.load_one( | ||
# rubocop:enable Style/Stuff | ||
{name: "name"} | ||
) | ||
&.rules) | ||
.freeze |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crimes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the downside, i'm currently still debugging even more crimes