NixOS/nixfmt

Breaks doc comments

Closed this issue · 2 comments

Description

Doc comments as defined in RFC 145 pretty consistently get broken by nixfmt.

Small example input

{
	/**Doc for lambda function bound to a variable*/
	assigned = x: x;

	/**
	  The identity function
	 */
	id = x: x; 	
}

Expected output

{
  /** Doc for lambda function bound to a variable */
  assigned = x: x;

  /**
    The identity function
  */
  id = x: x;
}

Actual output

{
  # *Doc for lambda function bound to a variable
  assigned = x: x;

  /* *
     	  The identity function
  */
  id = x: x;
}

I remember comment handling generally being broken, but not that broken. Are you using nixfmt-rfc-style?

My bad, was using the outdated version in nixpkgs.