Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment at the top of function body is missing indentation #383

Open
DavHau opened this issue Mar 23, 2023 · 1 comment
Open

Comment at the top of function body is missing indentation #383

DavHau opened this issue Mar 23, 2023 · 1 comment

Comments

@DavHau
Copy link

DavHau commented Mar 23, 2023

alejandra: 3.0.0
input:

let
  loadField = field: val:
    # This commend is indented incorrectly
    if field == val
    then "foo"
    else "bar";
in
  loadField

output:

let
  loadField = field: val:
  # This commend is indented incorrectly
    if field == val
    then "foo"
    else "bar";
in
  loadField
@piegamesde
Copy link
Contributor

Due to the way Alejandra works internally, "Comment at the top of function body is missing indentation" would be a more appropriate title. (The code responsible for this is on the outside, i.e. function application.) Additionally, it would be interesting to test if this also happens inside other language features like let blocks.

@DavHau DavHau changed the title Comment before if statement not indented correctly Comment at the top of function body is missing indentation Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants