Open m-iwanicki opened 1 month ago
Fixing the end of the file also causes problems for me in sli.dev, which I have used for Dasharo/presentation since DUG#7. On one side, there is a requirement for a surrounding heading, so if I have a heading in the last line surrounded, then this fixer comes saying there is a need to remove the empty line at the end of the file.
I think that's different from this issue. My issue was that pre-commit-init.py
generates 'faulty' config (with 2 newlines at the end of the file when we want only 1 line).
In most cases I think it's correct to trim excess newlines and when it isn't then config can be modified per repository to ignore files/extensions. Unless we always want to not trim some files then it could be added here.
Possibly also add .patch
files because I think they always are generated with 2 newlines at the end. Or maybe ignore .patch
files completely.
I understand you have different issue. Just saying this is nit first time this feature leads to problems. If there be more cases like this maybe we should agree it is not critical or configure it better.
initializes pre-commit that fails it's own checks:
There were 2 newlines at the end of
.pre-commit-config.yaml