[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-06 Thread Owen Pan via cfe-commits
owenca wrote: Probably. See #80628 for a fix. https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-04 Thread Ben Hamilton via cfe-commits
bhamiltoncx wrote: Interesting! Might be because you changed the logic to always read from stdin if no args are specified? I wasn't quite sure what that part of your change was about. On Sun, Feb 4, 2024, 16:04 Owen Pan ***@***.***> wrote: > @bhamiltoncx Thanks

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-04 Thread Owen Pan via cfe-commits
owenca wrote: @bhamiltoncx Thanks for the fix! Nevertheless, it seems that this triggered a new regression. See #80621. https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-23 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx closed https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -547,18 +547,20 @@ static void PrintVersion(raw_ostream &OS) { // Dump the configuration. static int dumpConfig(bool IsSTDIN) { std::unique_ptr Code; - // We can't read the code to detect the language if there's no file name. - if (!IsSTDIN) { -// Read in the code in

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx updated https://github.com/llvm/llvm-project/pull/79051 >From 893c295ea7ff5fda9953420068fae2af7457c5c1 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 22 Jan 2024 11:33:18 -0700 Subject: [PATCH] [Format] Fix detection of languages when reading from stdin -

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread via cfe-commits
https://github.com/gulfemsavrun updated https://github.com/llvm/llvm-project/pull/79051 >From 893c295ea7ff5fda9953420068fae2af7457c5c1 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 22 Jan 2024 11:33:18 -0700 Subject: [PATCH] [Format] Fix detection of languages when reading from stdin

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: clang-format -dump-config - < %s | FileCheck %s bhamiltoncx wrote: In this case, we do want two tests (at least, we do need the integration test in `clang/test/Format/dump-config-objc-stdin.m` to reproduce the issue). The reason is, the

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Björn Schäpers via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: clang-format -dump-config - < %s | FileCheck %s HazardyKnusperkeks wrote: I don't think you need this, right? The unit tests does the same, or not? https://github.com/llvm/llvm-project/pull/79051 _

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Björn Schäpers via cfe-commits
@@ -547,18 +547,20 @@ static void PrintVersion(raw_ostream &OS) { // Dump the configuration. static int dumpConfig(bool IsSTDIN) { std::unique_ptr Code; - // We can't read the code to detect the language if there's no file name. - if (!IsSTDIN) { -// Read in the code in

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Ben Hamilton (Ben Gertzfield) (bhamiltoncx) Changes The code cleanup in #74794 accidentally broke detection of languages by reading file content from stdin, e.g. via `clang-format -dump-config - < /path/to/filename`. This PR adds

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx created https://github.com/llvm/llvm-project/pull/79051 The code cleanup in #74794 accidentally broke detection of languages by reading file content from stdin, e.g. via `clang-format -dump-config - < /path/to/filename`. This PR adds unit and integration tests t