Skip to content

Commit 8d45fbe

Browse files
committed
fix: exclude burr/examples symlink from end-of-file-fixer pre-commit hook
end-of-file-fixer mistreats the symlink as a regular text file and appends '\n' to the link target, turning '../examples' (11 bytes) into '../examples\n' (12 bytes). Strict consumers (Apache RAT, Linux tar extractors) then fail to resolve the symlink. This is exactly the bug that motivated PR #748 — without this exclude, the next pre-commit run on a maintainer's machine would silently re-corrupt the symlink. Also exclude trailing-whitespace defensively for the same reason.
1 parent b18eee6 commit 8d45fbe

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,17 @@ repos:
3232
rev: v4.5.0
3333
hooks:
3434
- id: trailing-whitespace
35-
# ensures files are either empty or end with a blank line
35+
# burr/examples is a symlink. trailing-whitespace would mangle the
36+
# link target text (treating "../examples" as a "trailing whitespace"
37+
# situation) and break the symlink.
38+
exclude: '^burr/examples$'
39+
# ensures files are either empty or end with a blank line.
40+
# NOTE: burr/examples is excluded — end-of-file-fixer will append "\n"
41+
# to the symlink target turning "../examples" into "../examples\n",
42+
# which makes the symlink unresolvable on strict consumers (Apache RAT
43+
# and several Linux tarball extractors). See PR #748.
3644
- id: end-of-file-fixer
45+
exclude: '^burr/examples$'
3746
# sorts requirements
3847
- id: requirements-txt-fixer
3948
# valid python file

0 commit comments

Comments
 (0)