Open SpecLad opened 1 year ago
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.
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.