1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-30 12:07:46 +00:00

Merge pull request #143 from kamadorueda/kamadorueda

feat: continue lambda on the same line
This commit is contained in:
Kevin Amado 2022-02-18 17:08:31 -05:00 committed by GitHub
commit 81ce4c563f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 33 deletions

View file

@ -60,6 +60,19 @@ Types of changes
+ {pkgs, ...}:
```
- Pattern matching lambdas now follow the equal sign:
```diff
- fnLocationRelative =
- {
- name,
- value,
- }:
+ fnLocationRelative = {
+ name,
+ value,
+ }:
```
## [0.2.0] - 2022-02-17
### Added

View file

@ -65,23 +65,7 @@ pub fn rule(
let child = children.get_next().unwrap();
match layout {
crate::config::Layout::Tall => {
if is_pattern_type
|| comment
|| (matches!(
child.element.kind(),
rnix::SyntaxKind::NODE_LAMBDA
) && matches!(
child
.element
.clone()
.into_node()
.unwrap()
.children()
.next()
.unwrap()
.kind(),
rnix::SyntaxKind::NODE_PATTERN
))
if comment
|| !matches!(
child.element.kind(),
rnix::SyntaxKind::NODE_ATTR_SET

View file

@ -16,4 +16,21 @@
{ }:
a: b: c:
a)
({pkgs, ...}: {
# Stuff
})
({pkgs, ...}: let
in pkgs)
(a: {b,
...}: c: {
# Stuff
})
(a: {b, c,
...}: d: {
# Stuff
})
]

View file

@ -4,18 +4,16 @@
c
*/
d)
({}:
b:
/*
c
*/
d)
(a:
{}:
/*
c
*/
d)
({}: b:
/*
c
*/
d)
(a: {}:
/*
c
*/
d)
(a: d)
(a:
/*
@ -48,8 +46,26 @@
locationsXml,
}:
null)
(a: b: c:
{}:
a: b: c:
a)
(a: b: c: {}: a: b: c:
a)
({pkgs, ...}: {
# Stuff
})
({pkgs, ...}: let
in
pkgs)
(a: {b, ...}: c: {
# Stuff
})
(a: {
b,
c,
...
}: d: {
# Stuff
})
]