mixed-line-ending false positive failure on Windows
See original GitHub issueSteps to reproduce:
create git repository on Windows platform
add file .gitattributes with content:
* text=auto
setup pre-commit hook with:
mixed-line-ending
args: ['--fix=lf']
Create text file yourfile.c with CRLF line endigs. Add it to git repository. Stage it. Commit it.
Expected result:
Mixed line ending........................................................Passed
as git automatically converts CRLF to LF when commiting
Actual result:
Mixed line ending........................................................Failed
- hook id: mixed-line-ending
- exit code: 1
- files were modified by this hook
stage modified file, git warns you:
Stage 1 files
warning: LF will be replaced by CRLF in yourfile.c.
The file will have its original line endings in your working directory
Done
Commit:
Mixed line ending........................................................Passed
At this point, I am not sure which line endings end up committed in repository. Probably LF, as this test passes on server running Linux which checks pull requests.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Address false positives/negatives in Microsoft Defender for ...
Learn how to handle false positives or false negatives in Microsoft Defender for Endpoint.
Read more >Salt 2018.3.3 Release Notes
5fee38d1db Fixes various tests that were failing under python 3.7. ... 53ba10ad5f Skip pylint false-positives.
Read more >Writing better Python code, automatically - mje.nz
It produces more false positives than Flake8 but also catches more bugs, ... MASTER] disable = # Fails in pre-commit venv import-error, ...
Read more >flux-core
stop-on-failure=N Automatically stop a cron entry if the failure count ... success True of False if job completed successfully, empty string ...
Read more >Microsoft Defender is detecting a false-positive threat "Win32 ...
This detection is not malware , but a bug, so check that you have the latest security intelligence update to fix the issue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for quick response. So if this is technical limitation, I would propose to document it. https://github.com/pre-commit/pre-commit-hooks/pull/437
that recommendation (afaik) is only due to older tools defaulting to crlf on windows – though most tools on windows work fine with just lf endings now-a-days