From d49497ce6c15fc8e0ee63820cbb9711e9544870b Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Thu, 7 Nov 2024 11:57:50 +0100 Subject: [PATCH] Exclude symlink from pre-commit end-of-file-fixer Git on Windows clones the symlink `test/python/requirements.txt` as a regular file. That's not a big deal except that `pre-commit`, executed by `winmake.ps1 lint`, complains because there is no new line at end of the file. To fix `winmake.ps1 lint` we exclude the symlink in `pre-commit` hook `end-of-file-fixer` configuration. Signed-off-by: Mario Loriedo --- .pre-commit-config.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec9b202ece..024739820b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,11 +8,12 @@ repos: # trailing whitespace as part of its format. We can work around that, # but unfortunately the buildah repo has some files with tabs, which # git-diff formats as '[+/-]', which these hooks choke on. - # `contrib/systemd/user` is a symlink but for some reason, on windows, - # pre-commit consider it as a regular file and tries to fix it. - # Just disable checks on these files as a special case. + # `contrib/systemd/user` and `test/python/requirements.txt` are symlinks + # but for some reason, on windows, pre-commit consider it as a regular + # file and tries to fix it. Just disable checks on these files as a + # special case. - id: end-of-file-fixer - exclude: test/buildah-bud/buildah-tests.diff|contrib/systemd/user + exclude: test/buildah-bud/buildah-tests.diff|contrib/systemd/user|test/python/requirements.txt - id: trailing-whitespace exclude: test/buildah-bud/buildah-tests.diff|test/e2e/quadlet/remap-keep-id2.container|test/e2e/quadlet/line-continuation-whitespace.container - id: mixed-line-ending