Document how to avoid redundant newline at the end of `.copier-answers.yml`.
See original GitHub issueIs your feature request related to a problem? Please describe.
Currently, there is a redundant newline at the end of the generated .copier-answers.yml
which violate the hook end-of-file-fixer
in pre-commit-hook.
Describe the solution you’d like
No redundant newline at the end of .copier-answers.yml
.
Describe alternatives you’ve considered
N/A
Additional context
I tried to find the related code but failed, if with guidance, I am willing to fix this tiny issue if confirmed.
Issue Analytics
- State:
- Created 9 months ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
format add an extra line at the end of the file · Issue #282
When insert=false and the file already ends in a new line, it is removed as "redundant", which seems to be to be incorrect...
Read more >No Newline at End of File - Thoughtbot
A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character....
Read more >What's the significance of the "No newline at end of file" log?
It indicates that you do not have a newline (usually \n , aka LF or CRLF) at the end of file. That is,...
Read more >What's the point in adding a new line to the end of a file?
It's not about adding an extra newline at the end of a file, it's about not removing the newline that should be there....
Read more >On save new line added to end of file. How stop this?
I looked in settings but there are so many I am not sure where to look. When I save a file, PhpStorm adds...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Have you tried adding a
-
character at the end of the Jinja expression?The lack of that instruction is not a bug. It’s just something that will produce a file with 2 empty lines at the end, which is most likely not what you want, but is not really an invalid yaml file.
So, you can leave all the code and tests as they are. Just update the docs and readme.