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

multiline string content gets modified, altering outputs #325

Open
srhb opened this issue Feb 7, 2024 · 2 comments
Open

multiline string content gets modified, altering outputs #325

srhb opened this issue Feb 7, 2024 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@srhb
Copy link

srhb commented Feb 7, 2024

Describe the bug
(Note that whitespace is the crux of the issue here, if you're viewing in a browser you may have trouble seeing the differences)

Output files differ because whitespace is altered within multiline strings.

https://gist.github.com/srhb/cfb85687f9cb9ad961079960d7d10af8


**To Reproduce**
Steps to reproduce the behavior:

`unformatted.nix` is the raw nix file.
`formatted.nix` is the same file after running `nixpkgs-fmt` from this devShell at 7301bc9f2ba29fe693c04cbcaa12110eb9685c71

result-unformatted is the resultant text-file from nix-build'ing `unformatted.nix`
result-formatted is the resultant text-file from nix-build'ing `formatted.nix`

**Expected behavior**
The outputs are the same

**System information**

* `nixpkgs-fmt --version`
nixpkgs-fmt 1.3.0

**Additional context**
@srhb srhb added bug Something isn't working needs triage labels Feb 7, 2024
@srhb
Copy link
Author

srhb commented Feb 7, 2024

Hmm, I wonder if this is actually an rnix problem.

@srhb
Copy link
Author

srhb commented Feb 7, 2024

Oh, and now I realize you have a nifty automated test thingy.

https://github.com/srhb/nixpkgs-fmt/tree/try-auto-test-good-bad-whitespace-in-multiline

cargo test should show the test failure in that branch's devShell

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