-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Final newline stripped from fragment template #108
Comments
The following is not a solution, but a general tip to enforce styles and preferences on projects. To enforce this across all files -- regardless of what tool or generates the file -- you can use the "end-of-file-fixer" pre-commit hook to ensure that all text files end with a newline, a la: repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
hooks:
- id: "end-of-file-fixer" That fixer will enforce that all files end with a newline before they can be committed to the repo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a custom new fragment template is used, scriv strips the final newline from it when it creates the fragment. For example, create the following
scriv.ini
:Then create
fragment.j2
as follows:Now create a fragment and examine it:
This is mildly annoying, as I'd like all my text files to end with a newline.
The text was updated successfully, but these errors were encountered: