kamadorueda / alejandra

The Uncompromising Nix Code Formatter
https://kamadorueda.github.io/alejandra/
The Unlicense
827 stars 40 forks source link

double-asterisk in block comment opening delimiter forced onto separate lines #390

Open montchr opened 1 year ago

montchr commented 1 year ago

https://kamadorueda.com/alejandra/?before=%7B%0A++%2F**%0A++Convert+a+boolean+to+a+%22yes%22+or+%22no%22+string.%0A%0A++Commonly+useful+in+program+configuration+files.%0A%0A++Type%3A+boolToOnOffString+%3A%3A+boolean+-%3E+string%0A++*%2F%0A++boolToOnOffString+%3D+value%3A%0A++++if+value%0A++++then+%22on%22%0A++++else+%22off%22%3B%0A%7D

Expected

{
  /**
  Convert a boolean to a "yes" or "no" string.

  Commonly useful in program configuration files.

  Type: boolToOnOffString :: boolean -> string
  */
  boolToOnOffString = value:
    if value
    then "on"
    else "off";
}

Actual

{
  /*
    *
  Convert a boolean to a "yes" or "no" string.

  Commonly useful in program configuration files.

  Type: boolToOnOffString :: boolean -> string
  */
  boolToOnOffString = value:
    if value
    then "on"
    else "off";
}

I am aware of RFC 0145, but I intentionally retained the first-level indentation of the comment body since this issue is about /** specifically