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

feat: do not indent lambdas with comments

This commit is contained in:
Kevin Amado 2022-02-18 17:27:21 -05:00
parent aa08ae37c5
commit 750bf55cf7
No known key found for this signature in database
GPG key ID: FFF341057F503148
4 changed files with 35 additions and 1 deletions

View file

@ -78,6 +78,18 @@ Types of changes
- with pkgs;
+ binPath = with pkgs;
```
- Nested lambdas are now not indented:
```diff
# comment
a:
- # comment
- b:
- _
+ # comment
+ b:
+ _
```
## [0.2.0] - 2022-02-17

View file

@ -79,10 +79,11 @@ pub fn rule(
child.element.kind(),
rnix::SyntaxKind::NODE_ATTR_SET
| rnix::SyntaxKind::NODE_PAREN
| rnix::SyntaxKind::NODE_LAMBDA
| rnix::SyntaxKind::NODE_LET_IN
| rnix::SyntaxKind::NODE_LIST
| rnix::SyntaxKind::NODE_STRING
) && build_ctx.pos_new.column > 1;
);
if should_indent {
steps.push_back(crate::builder::Step::Indent);

View file

@ -0,0 +1,9 @@
{
traceIf =
# Predicate to check
pred:
# Message that should be traced
msg:
# Value to return
x: if pred then trace msg x else x;
}

View file

@ -0,0 +1,12 @@
{
traceIf =
# Predicate to check
pred:
# Message that should be traced
msg:
# Value to return
x:
if pred
then trace msg x
else x;
}