[clang] [clang-format] Fix working -assume-filename with .clang-format-ignore (PR #113100)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 23 23:46:02 PDT 2024
================
@@ -46,5 +46,16 @@
// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}}
// CHECK5-NOT: foo.js
+// RUN: echo "foo.*" > .clang-format-ignore
+// RUN: touch foo.c
+// RUN: echo foo | clang-format -assume-filename=foo.c 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK6 -allow-empty
+// CHECK6-NOT: foo
+
+// RUN: touch bar.c
+// RUN: echo foo | clang-format -assume-filename=bar.c 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK7 -allow-empty
+// CHECK7: foo
----------------
owenca wrote:
```suggestion
// RUN: clang-format -assume-filename=bar.c < foo.c \
// RUN: | FileCheck %s -check-prefix=CHECK7 -match-full-lines
// CHECK7: int i;
```
https://github.com/llvm/llvm-project/pull/113100
More information about the cfe-commits
mailing list