Skip to content

pkgs/*: add final newline to multiple files #102950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 9, 2020

Conversation

samuelgrf
Copy link
Member

Done by running sed -i '$a\' $(fd -t f) and selectively commiting the changed files. I made sure not to commit binary files, crypto keys, .patch/.diff files and files created via update scripts.
I seperated the changes by file type to make this easier to review.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@ofborg ofborg bot added 6.topic: emacs Text editor 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: ruby 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 labels Nov 5, 2020
@@ -1,3 +1,3 @@
* Build the RTS separately from Idris
* idris2nix
* Only require gmp, rts when compiling executables
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub does not show the final missing new line here. Maybe an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a GitHub issue, the newline change shows up in Git.

@samuelgrf
Copy link
Member Author

The last commit fixes the failing editorconfig check.

@infinisil
Copy link
Member

What's the motivation for this?

@samuelgrf samuelgrf changed the title treewide: add final newline to multiple files pkgs/*: add final newline to multiple files Nov 5, 2020
@samuelgrf
Copy link
Member Author

Ugh I somehow commited a testing branch full of generated files, this pr changes way fewer files now.
Sorry for all the pings.

@samuelgrf
Copy link
Member Author

@infinisil
A few reasons:

  • We have a rule about this in our .editorconfig file and github's checks fail if someone changes one of these files without adding a final newline.
  • Some editors like vim or nano also add it every time a file that didn't previously have a final newline is saved, causing unnecessary noise in git diffs.
  • It's part of both the POSIX and C standard, Linters and Compilers complain about this and some commands like cat or wc -l don't work as expected.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 6.topic: emacs Text editor 6.topic: ruby labels Nov 5, 2020
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Nov 6, 2020

@infinisil
A few reasons:

  • We have a rule about this in our .editorconfig file and github's checks fail if someone changes one of these files without adding a final newline.
  • Some editors like vim or nano also add it every time a file that didn't previously have a final newline is saved, causing unnecessary noise in git diffs.
  • It's part of both the POSIX and C standard, Linters and Compilers complain about this and some commands like cat or wc -l don't work as expected.

git can't generate good diffs of last lines without a new line behind it.

@alyssais alyssais merged commit 433c1a7 into NixOS:master Nov 9, 2020
@samuelgrf samuelgrf deleted the final-newline branch March 5, 2022 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants