Skip to content

Commit

Permalink
Disable clang-format entirely for test directories
Browse files Browse the repository at this point in the history
See discussion here:

#55982

And the RFC here:
https://discourse.llvm.org/t/rfc-disable-clang-format-in-the-clang-test-tree/63498/2

We don't generally expect test files to be formatted according to the
style guide. Indeed, some tests may require specific formatting for the
purposes of the test.

When tests intentionally do not conform to the "correct" formatting,
this causes errors in the CI, which can drown out real errors and causes
people to stop trusting the CI over time.

From the history of the clang/test/.clang-format file, it looks as if
there have been attempts to make clang-format do a subset of formatting
that would be useful for tests. However, it looks as if it's hard to
make clang-format do exactly the right thing -- see the back-and-forth
between
13316a7
and
7b5bddf.

These changes disable the .clang-format file for clang/test, llvm/test,
and clang-tools-extra/test.

Fixes #55982
Differential Revision: https://reviews.llvm.org/D128706
  • Loading branch information
AaronBallman committed Jul 8, 2022
1 parent 35f4857 commit fee77a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions clang-tools-extra/test/.clang-format
@@ -1,2 +1 @@
BasedOnStyle: LLVM
ColumnLimit: 0
DisableFormat: true
4 changes: 1 addition & 3 deletions clang/test/.clang-format
@@ -1,3 +1 @@
BasedOnStyle: LLVM
ColumnLimit: 0
AlwaysBreakTemplateDeclarations: No
DisableFormat: true
3 changes: 1 addition & 2 deletions llvm/test/.clang-format
@@ -1,2 +1 @@
BasedOnStyle: LLVM
ColumnLimit: 0
DisableFormat: true

0 comments on commit fee77a2

Please sign in to comment.