Skip to content

Commit

Permalink
gitattributes: make all JSON files end with LF
Browse files Browse the repository at this point in the history
A really specific bug occurred on CI runs on all Windows machines
https://github.com/theupdateframework/python-tuf/runs/5467473050?check_suite_focus=true
where we weren't able to verify that what was generated is the same
as the stored on Git.

After research with Jussi, we found out that the problem comes not
from the content of the file that was generated, but because on Windows
Git proactively replaced all line endings for text files with CRLF symbol
("\r") this made the locally stored JSON files different from the one
generated.

We want to make sure such bugs doesn't occur again and that's why we
disable this behavior for all JSON files.

Signed-off-by: Martin Vrachev <[email protected]>
  • Loading branch information
MVrachev committed Mar 22, 2022
1 parent ff770ea commit 69cc684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Files that will always have LF line endings on checkout.
tests/repository_data/** text eol=lf

# All JSON files will always have LF line endings on checkout.
# This prevents git replacing line endings with CRLF on Windows.
*.json text eol=lf

0 comments on commit 69cc684

Please sign in to comment.