Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcae0d87

Browse files
committed
Don't fix end-of-file in files named like licenses
The unanchored `LICENSE` and `COPYING` alternatives match thepattern anywhere, and therefore exclude the currently used path`fuzzing/LICENSE-BSD`.License files are more likely than other files in this project tobe introduced as symlinks, and less likely to be noticedimmediately if they break. Symlinks can be checked out as regularfiles when `core.symlinks` is set to `false`, which is rare outsideof Windows but is the default behavior when unset on Windows.This exclusion fixes the current problem that end-of-file-fixerbreaks those links by adding a newline character to the end (thesymlinks are checked out broken if that is committed). It alsoguards against most future cases involving licenses, thoughpossibly not all, and not other unrelated cases where symlinks maybe used for other purposes.Although the pre-commit-hooks repository also provides adestroyed-symlinks hook that detects the situation of a symlinkthat has been replaced by a regular file, this does not add thathook, because this situation is not inherently a problem. The codehere does not require symlinks to be checked out to work, andadding that would break significant uses of the repository onWindows.Note that this leaves the situation where a license file may be asymlink to another license file and may thus be checked out as aregular file containing that file's path. However, it is easy tounderstand that situation and manually follow the path. Thatdiffers from the scenario where a symlink is created but broken,because attempting to open it gives an error, and the error messageis often non-obvious, reporting that a file is not found but givingthe name of the symlink rather than its target.
1 parente978248 commitcae0d87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
rev:v4.6.0
2727
hooks:
2828
-id:end-of-file-fixer
29-
exclude:^test/fixtures/
29+
exclude:^test/fixtures/|COPYING|LICENSE
3030
-id:check-symlinks
3131
-id:check-toml
3232
-id:check-yaml

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp