The file-contents-sorter uses the default python sorter which places items with a leading exclamation mark before the equivalent file. When this is used on the .gitignore file, it breaks the functionality to include files of a specific name after a more generic name was ignored.
For example, the following .gitignore file will ignore test1-example
!test*-example
test*
but this next will not ignore test1-example
test*
!test*-example
Using the file sorter pre-commit hook as is breaks the management of ignored files.
Can an option be added to place leading exclamation mark lines to the end of the file? This could be further generalized to allow any matching regex to be placed at the end of the file.
The
file-contents-sorter
uses the default python sorter which places items with a leading exclamation mark before the equivalent file. When this is used on the.gitignore
file, it breaks the functionality to include files of a specific name after a more generic name was ignored.For example, the following
.gitignore
file will ignoretest1-example
but this next will not ignore
test1-example
Using the file sorter pre-commit hook as is breaks the management of ignored files.
Can an option be added to place leading exclamation mark lines to the end of the file? This could be further generalized to allow any matching regex to be placed at the end of the file.