mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 04:57:44 +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));
|
steps.push_back(crate::builder::Step::FormatWider(child.element));
|
||||||
}
|
}
|
||||||
crate::config::Layout::Wide => {
|
crate::config::Layout::Wide => {
|
||||||
steps.push_back(crate::builder::Step::Whitespace);
|
|
||||||
steps.push_back(crate::builder::Step::Format(child.element));
|
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::NewLine);
|
||||||
steps.push_back(crate::builder::Step::Pad);
|
steps.push_back(crate::builder::Step::Pad);
|
||||||
}
|
}
|
||||||
crate::config::Layout::Wide => {
|
crate::config::Layout::Wide => {}
|
||||||
steps.push_back(crate::builder::Step::Whitespace);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
steps.push_back(crate::builder::Step::Format(child.element));
|
steps.push_back(crate::builder::Step::Format(child.element));
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
( a b )
|
(a b)
|
||||||
( a b )
|
(a b)
|
||||||
(
|
(
|
||||||
a
|
a
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( assert b; c )
|
(assert b; c)
|
||||||
(
|
(
|
||||||
assert b;
|
assert b;
|
||||||
/*
|
/*
|
||||||
|
@ -26,9 +26,7 @@
|
||||||
*/
|
*/
|
||||||
c
|
c
|
||||||
)
|
)
|
||||||
(
|
(assert b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
|
||||||
assert b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
|
||||||
)
|
|
||||||
(
|
(
|
||||||
assert b;
|
assert b;
|
||||||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( 1 + 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
|
+ 1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
/**/
|
/**/
|
||||||
|
@ -19,29 +19,29 @@
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
|
@ -49,29 +49,29 @@
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
@ -79,29 +79,29 @@
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
else
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
then
|
then
|
||||||
( if a then b else c )
|
(if a then b else c)
|
||||||
else
|
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
|
inherit
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
h
|
h
|
||||||
/*
|
/*
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
/*
|
/*
|
||||||
g
|
g
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
/*
|
/*
|
||||||
g
|
g
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
inherit
|
inherit
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -510,7 +510,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
h
|
h
|
||||||
;
|
;
|
||||||
|
@ -520,7 +520,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
h
|
h
|
||||||
/*
|
/*
|
||||||
|
@ -533,7 +533,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
/*
|
/*
|
||||||
g
|
g
|
||||||
|
@ -546,7 +546,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
f
|
f
|
||||||
/*
|
/*
|
||||||
g
|
g
|
||||||
|
@ -562,7 +562,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -575,7 +575,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -591,7 +591,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -607,7 +607,7 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( a: d )
|
(a: d)
|
||||||
(
|
(
|
||||||
a:
|
a:
|
||||||
/*
|
/*
|
||||||
|
@ -26,9 +26,7 @@
|
||||||
*/
|
*/
|
||||||
d
|
d
|
||||||
)
|
)
|
||||||
(
|
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
||||||
)
|
|
||||||
(
|
(
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( a ? 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
|
||||||
? a
|
? a
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(
|
(
|
||||||
( ( c ) )
|
((c))
|
||||||
(
|
(
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
@ -73,13 +73,13 @@
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
/*
|
/*
|
||||||
a
|
a
|
||||||
*/
|
*/
|
||||||
( c )
|
(c)
|
||||||
/*
|
/*
|
||||||
e
|
e
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( { } @ a: _ )
|
({ } @ a: _)
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
a:
|
a:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
( a @ { }: _ )
|
(a @ { }: _)
|
||||||
(
|
(
|
||||||
a @
|
a @
|
||||||
/**/
|
/**/
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[
|
[
|
||||||
( { }: _ )
|
({ }: _)
|
||||||
(
|
(
|
||||||
{ /**/
|
{ /**/
|
||||||
}:
|
}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
( { ... }: _ )
|
({ ... }: _)
|
||||||
(
|
(
|
||||||
{ ...
|
{ ...
|
||||||
/**/
|
/**/
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
}:
|
}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
( { b, e, ... }: _ )
|
({ b, e, ... }: _)
|
||||||
(
|
(
|
||||||
{ b
|
{ b
|
||||||
, e
|
, e
|
||||||
|
@ -1043,7 +1043,7 @@
|
||||||
}:
|
}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
( { a ? null }: _ )
|
({ a ? null }: _)
|
||||||
(
|
(
|
||||||
{ /*
|
{ /*
|
||||||
a
|
a
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( a.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
|
a
|
||||||
.a
|
.a
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
( with b; c )
|
(with b; c)
|
||||||
(
|
(
|
||||||
with b;
|
with b;
|
||||||
/*
|
/*
|
||||||
|
@ -26,9 +26,7 @@
|
||||||
*/
|
*/
|
||||||
c
|
c
|
||||||
)
|
)
|
||||||
(
|
(with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
|
||||||
with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
|
||||||
)
|
|
||||||
(
|
(
|
||||||
with b;
|
with b;
|
||||||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue