-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to ignore line endings when matching lines from --exclude-file
#1888
Comments
Yeah I'd agree, the line ending should be irrelevant within any of our config files (--exclude-file, --ignore-word-list) etc. |
I'm reopening this because the new |
It seems to be working as expected for me: $ file exclude-file1.txt exclude-file2.txt test1.txt test2.txt
exclude-file1.txt: ASCII text
exclude-file2.txt: ASCII text, with CRLF line terminators
test1.txt: ASCII text
test2.txt: ASCII text, with CRLF line terminators
$
$ codespell test1.txt test2.txt
test1.txt:1: accepecting ==> accepting
test2.txt:1: accepecting ==> accepting
$
$ codespell -x exclude-file1.txt test1.txt test2.txt
$
$ codespell -x exclude-file2.txt test1.txt test2.txt
$ However, the above works whatever spaces we add at the end of any of the above files. It looks like all trailing newlines and spaces are not taken into account when matching lines. Perhaps spaces should be taken into account when matching. |
I'm pretty sure that was an intentional choice, trailing space is a nightmare to deal with and requiring that the line in ignore file contains that space doesn't seem to actually benefit you in any way since the contents of the line are still identical. |
This can be especially when repository is used on Windows with git's
core.autocrlf
set totrue
as then some files can have CRLF line endings locally even though they're checked out into git with LF endings. This mixing can therefore causecodespell
to not ignore some lines if the line endings in--exclude-file
differ from line endings in the file with spelling issue.The text was updated successfully, but these errors were encountered: