nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
374 stars 89 forks source link

[nitpick] Prevent emitting of trailing whitespace #167

Closed fogti closed 3 years ago

fogti commented 3 years ago

Some lines of the produced Cargo.nix file in multiple crates I either use or manage contain lines which either have trailing space characters ( ) or consist solely of spaces.

fogti commented 3 years ago

The fix seems to be almost good enough, but some regenerated Cargo.nix files seem to have no trailing newline. Additionally, some Cargo.nix files now have a leading newline.

kolloch commented 3 years ago

Yeah, never understood this trailing newline business. Seems redundant, why do tools screem about it?

fogti commented 3 years ago

Nah, in many editors (e.g. nano) it's extremely annoying to not have a trailing newline, if the last line is long, as it is not trivial to insert a line after it.

kolloch commented 3 years ago

Wow, that seems quite broken.

Even if trailing newlines are a problem somewhere, especially editors should be able to fix that.

I personally never encountered problems with trailing spaces or missing trailing newlines except that some tools show them and complain.

That said, it is really easy to fix in crate2nix so if it helps you or others...