This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Force LF newlines when writing files
ClosedPublic

Authored by LegalizeAdulthood on Jan 17 2022, 10:04 PM.

Details

Summary

The recommendation on Windows is to checkout from git with
core.autolf=false in order to preserve LF line endings on
test files. However, when creating a new check this results
in modified files as having switched all the line endings on
Windows. Write all files with explicit LF line endings to
prevent this.

Fixes #52968

Diff Detail

Event Timeline

LegalizeAdulthood requested review of this revision.Jan 17 2022, 10:04 PM
Quuxplusone accepted this revision.Jan 18 2022, 3:04 AM

LGTM FWIW.
I might even wonder why this code is using io.open instead of just plain open. (I didn't know io.open was a thing; StackOverflow tells me that it was something in Python2 but that in Python3 it's a synonym for open.)

This revision is now accepted and ready to land.Jan 18 2022, 3:04 AM
aaron.ballman accepted this revision.Jan 18 2022, 5:48 AM

LGTM, thanks!