Skip to content

Commit 34de122

Browse files
kakkokoowenca
andauthored
Apply suggestions from code review
Co-authored-by: Owen Pan <[email protected]>
1 parent e3eb2de commit 34de122

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

clang/test/Format/clang-format-ignore.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@
4747
// CHECK5-NOT: foo.js
4848

4949
// RUN: echo "foo.*" > .clang-format-ignore
50-
// RUN: touch foo.c
51-
// RUN: echo foo | clang-format -assume-filename=foo.c 2>&1 \
50+
// RUN: echo "int i ;" > foo.c
51+
// RUN: clang-format -assume-filename=foo.c < foo.c \
5252
// RUN: | FileCheck %s -check-prefix=CHECK6 -allow-empty
53-
// CHECK6-NOT: foo
53+
// CHECK6-NOT: int
5454

55-
// RUN: touch bar.c
56-
// RUN: echo foo | clang-format -assume-filename=bar.c 2>&1 \
57-
// RUN: | FileCheck %s -check-prefix=CHECK7 -allow-empty
58-
// CHECK7: foo
55+
// RUN: clang-format -assume-filename=bar.c < foo.c \
56+
// RUN: | FileCheck %s -check-prefix=CHECK7 -match-full-lines
57+
// CHECK7: int i;
5958

6059
// RUN: cd ..
6160
// RUN: rm -r %t.dir

clang/tools/clang-format/ClangFormat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ int main(int argc, const char **argv) {
708708
}
709709

710710
if (FileNames.empty()) {
711-
if (!AssumeFileName.empty() && isIgnored(AssumeFileName))
711+
if (isIgnored(AssumeFileName))
712712
return 0;
713713
return clang::format::format("-", FailOnIncompleteFormat);
714714
}

0 commit comments

Comments
 (0)