-
-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
Description
# Before
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").to eq("yyyyyyy"), "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
# After
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").to eq("yyyyyyy"),
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
The lack of indentation on the second line makes this quite hard to read.
Curiously, if .to
is replaced with some other two-letter method name, then the second line is indented by 5 spaces. (Is .to
special-cased somehow?). This works out better, but 5 spaces seems a little arbitrary:
# before
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").tp eq("yyyyyyy"), "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
#after
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").tp eq("yyyyyyy"),
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
Adding parenthesis to the method call makes things much cleaner:
# Before
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").to(eq("yyyyyyy"), "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz")
expect("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").to(
eq("yyyyyyy"),
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
)
Perhaps syntax_tree should always add parenthesis when method arguments need to be wrapped across multiple lines?