[clang] [clang-format] Make ignored files unformatted instead of empty. (PR #170416)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 7 20:57:25 PST 2025
================
@@ -701,9 +711,8 @@ int main(int argc, const char **argv) {
}
if (FileNames.empty()) {
- if (isIgnored(AssumeFileName))
- return 0;
- return clang::format::format("-", FailOnIncompleteFormat);
+ return clang::format::format("-", FailOnIncompleteFormat,
+ isIgnored(AssumeFileName));
----------------
owenca wrote:
> * The problem also persists with `clang-format ignored-file.cc`
Why should clang-format output the ignored files?
> * We also shouldn't always output the input file. When `--output-replacements-xml` is provided, we need to do different logic.
We can condition it on `!OutputXML` as shown in the updated suggested change above.
https://github.com/llvm/llvm-project/pull/170416
More information about the cfe-commits
mailing list