Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Full line comment wrongfully converted to same line comment #263

Open
DavHau opened this issue Sep 30, 2021 · 0 comments
Open

Full line comment wrongfully converted to same line comment #263

DavHau opened this issue Sep 30, 2021 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@DavHau
Copy link
Member

DavHau commented Sep 30, 2021

Describe the bug
executing nixpkgs-fmt on this:

{
  pkgs ? import <nixpkgs> {},
  lib ? pkgs.lib,
  externalSources ?
    # if called via CLI, load externals via env
    if builtins ? getEnv && builtins.getEnv "d2nExternalSources" != "" then
      builtins.getEnv "d2nExternalSources"
    # load from default dircetory
    else
      ./external,
}:

...results in this

{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, externalSources ? # if called via CLI, load externals via env
  if builtins ? getEnv && builtins.getEnv "d2nExternalSources" != "" then
    builtins.getEnv "d2nExternalSources"
  # load from default dircetory
  else
    ./external
,
}:

The full line comment originally from line 5 has been converted to a same line comment, so it looks like the comment is about externalSources, which is actually not the case. The comment was about the if statement in the next line

Expected behavior
The original comment of line 5, should remain a full line comment

System information

  • nixpkgs-fmt 1.2.0
@DavHau DavHau added bug Something isn't working needs triage labels Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant