diff --git a/test/.gitattributes b/test/.gitattributes new file mode 100644 --- /dev/null +++ b/test/.gitattributes @@ -0,0 +1,19 @@ +# CRLF (Windows) line endings take two bytes instead of one, so any tests that +# rely on or check fixed character -offset, Offset: or FileOffset: locations +# will fail when run on input files checked out with different line endings. + +# Most test input files should use native line endings, to ensure that we run +# tests against both line ending types. +* text=auto + +# These test input files rely on one-byte Unix (LF) line-endings, as they use +# fixed -offset, FileOffset:, or Offset: numbers in their tests. +clang-apply-replacements/ClangRenameClassReplacements.cpp text eol=lf +clang-apply-replacements/Inputs/basic/basic.h text eol=lf +clang-apply-replacements/Inputs/format/no.cpp text eol=lf +clang-apply-replacements/Inputs/format/yes.cpp text eol=lf +clang-tidy/infrastructure/export-diagnostics.cpp text eol=lf + +# These test input files rely on two-byte Windows (CRLF) line endings. +clang-apply-replacements/Inputs/crlf/crlf.cpp text eol=crlf +clang-apply-replacements/Inputs/crlf/crlf.cpp.expected text eol=crlf