You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
initializes pre-commit that fails it's own checks:
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
(...)
Fixing .pre-commit-config.yaml
There were 2 newlines at the end of .pre-commit-config.yaml
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: