mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
feat: dont put spaces around parens
This commit is contained in:
parent
4a23885541
commit
8cb32da9c8
13 changed files with 69 additions and 80 deletions
|
@ -38,7 +38,6 @@ pub fn rule(
|
|||
steps.push_back(crate::builder::Step::FormatWider(child.element));
|
||||
}
|
||||
crate::config::Layout::Wide => {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
steps.push_back(crate::builder::Step::Format(child.element));
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +57,7 @@ pub fn rule(
|
|||
steps.push_back(crate::builder::Step::NewLine);
|
||||
steps.push_back(crate::builder::Step::Pad);
|
||||
}
|
||||
crate::config::Layout::Wide => {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
}
|
||||
crate::config::Layout::Wide => {}
|
||||
}
|
||||
steps.push_back(crate::builder::Step::Format(child.element));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
( a b )
|
||||
( a b )
|
||||
(a b)
|
||||
(a b)
|
||||
(
|
||||
a
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( assert b; c )
|
||||
(assert b; c)
|
||||
(
|
||||
assert b;
|
||||
/*
|
||||
|
@ -26,9 +26,7 @@
|
|||
*/
|
||||
c
|
||||
)
|
||||
(
|
||||
assert b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
)
|
||||
(assert b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
|
||||
(
|
||||
assert b;
|
||||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( 1 + 1 )
|
||||
(1 + 1)
|
||||
(
|
||||
1
|
||||
+
|
||||
|
@ -37,7 +37,7 @@
|
|||
)
|
||||
)
|
||||
)
|
||||
( 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 )
|
||||
(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)
|
||||
(
|
||||
1
|
||||
+ 1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
(
|
||||
if
|
||||
/**/
|
||||
|
@ -19,29 +19,29 @@
|
|||
if
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
then
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
else
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
)
|
||||
then
|
||||
|
@ -49,29 +49,29 @@
|
|||
if
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
then
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
else
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
)
|
||||
else
|
||||
|
@ -79,29 +79,29 @@
|
|||
if
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
then
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
else
|
||||
(
|
||||
if
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
then
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
else
|
||||
( if a then b else c )
|
||||
(if a then b else c)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
{ inherit ( c ) f h; }
|
||||
{ inherit (c) f h; }
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
h
|
||||
/*
|
||||
|
@ -12,7 +12,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
/*
|
||||
g
|
||||
|
@ -22,7 +22,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
/*
|
||||
g
|
||||
|
@ -35,7 +35,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -45,7 +45,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -58,7 +58,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -71,7 +71,7 @@
|
|||
}
|
||||
{
|
||||
inherit
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -510,7 +510,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
h
|
||||
;
|
||||
|
@ -520,7 +520,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
h
|
||||
/*
|
||||
|
@ -533,7 +533,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
/*
|
||||
g
|
||||
|
@ -546,7 +546,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
f
|
||||
/*
|
||||
g
|
||||
|
@ -562,7 +562,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -575,7 +575,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -591,7 +591,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -607,7 +607,7 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( a: d )
|
||||
(a: d)
|
||||
(
|
||||
a:
|
||||
/*
|
||||
|
@ -26,9 +26,7 @@
|
|||
*/
|
||||
d
|
||||
)
|
||||
(
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
)
|
||||
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
|
||||
(
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( a ? a )
|
||||
(a ? a)
|
||||
(
|
||||
a
|
||||
?
|
||||
|
@ -37,7 +37,7 @@
|
|||
)
|
||||
)
|
||||
)
|
||||
( a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a )
|
||||
(a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a ? a)
|
||||
(
|
||||
a
|
||||
? a
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(
|
||||
( ( c ) )
|
||||
((c))
|
||||
(
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
@ -73,13 +73,13 @@
|
|||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
)
|
||||
(
|
||||
/*
|
||||
a
|
||||
*/
|
||||
( c )
|
||||
(c)
|
||||
/*
|
||||
e
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( { } @ a: _ )
|
||||
({ } @ a: _)
|
||||
(
|
||||
{
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
|||
a:
|
||||
_
|
||||
)
|
||||
( a @ { }: _ )
|
||||
(a @ { }: _)
|
||||
(
|
||||
a @
|
||||
/**/
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[
|
||||
( { }: _ )
|
||||
({ }: _)
|
||||
(
|
||||
{ /**/
|
||||
}:
|
||||
_
|
||||
)
|
||||
( { ... }: _ )
|
||||
({ ... }: _)
|
||||
(
|
||||
{ ...
|
||||
/**/
|
||||
|
@ -25,7 +25,7 @@
|
|||
}:
|
||||
_
|
||||
)
|
||||
( { b, e, ... }: _ )
|
||||
({ b, e, ... }: _)
|
||||
(
|
||||
{ b
|
||||
, e
|
||||
|
@ -1043,7 +1043,7 @@
|
|||
}:
|
||||
_
|
||||
)
|
||||
( { a ? null }: _ )
|
||||
({ a ? null }: _)
|
||||
(
|
||||
{ /*
|
||||
a
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( a.a )
|
||||
(a.a)
|
||||
(
|
||||
a
|
||||
.
|
||||
|
@ -18,9 +18,7 @@
|
|||
/**/
|
||||
a
|
||||
)
|
||||
(
|
||||
a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a
|
||||
)
|
||||
(a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a)
|
||||
(
|
||||
a
|
||||
.a
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
( with b; c )
|
||||
(with b; c)
|
||||
(
|
||||
with b;
|
||||
/*
|
||||
|
@ -26,9 +26,7 @@
|
|||
*/
|
||||
c
|
||||
)
|
||||
(
|
||||
with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
)
|
||||
(with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
|
||||
(
|
||||
with b;
|
||||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue