Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commitcae0d87
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
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
|
0 commit comments
Comments
(0)