https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/91317
>From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH 1/3] [clang-format] Add DiagHandler for getStyle function
It al
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/91317
>From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH 1/2] [clang-format] Add DiagHandler for getStyle function
It al
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
auto applyChildFormatTexts = [&](FormatStyl
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
pointhex wrote:
No problem.
https://github.com/pointhex updated
https://github.com/llvm/llvm-project/pull/91317
>From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH] [clang-format] Add DiagHandler for getStyle function
It allo
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
owenca wrote:
Sorry! We do n
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
auto applyChildFormatTexts = [&](FormatStyl
pointhex wrote:
I used to redirect output. I guess that is enough. Maybe, you know a better
solution for that.
```::testing::internal::CaptureStderr();
auto Style = getStyle("{invalid_key=invalid_value}", "a.h", "LLVM", "",
&FS, false);
...
const std::string output = ::testing::
https://github.com/pointhex updated
https://github.com/llvm/llvm-project/pull/91317
>From 6c8cc11d2d4591b06514f5f16e88ffd30d149488 Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH] [clang-format] Add DiagHandler for getStyle function
It allo
owenca wrote:
@mydeveloperday requested it. See
https://github.com/llvm/llvm-project/pull/91317#pullrequestreview-2095010527.
There are calls to `getStyle()` in `ConfigParseTest.cpp`. Maybe add a test
there?
https://github.com/llvm/llvm-project/pull/91317
_
pointhex wrote:
> Can you add a unit test?
Yes, no problem, I just didn't get if it is needed or not. Could you please
tell me if you already have a unit test for that function and where? I didn't
manage to find it.
https://github.com/llvm/llvm-project/pull/91317
owenca wrote:
> Am I right that no one has a major issue with the patch? So fixing the
> "const" issue and adding a unit test will let that in?
Can you add a unit test?
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-
pointhex wrote:
@mydeveloperday @owenca Kind reminder.
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3945,20 +3945,23 @@ const char *DefaultFallbackStyle = "LLVM";
llvm::ErrorOr>
loadAndParseConfigFile(StringRef ConfigFile, llvm::vfs::FileSystem *FS,
- FormatStyle *Style, bool AllowUnknownOptions) {
+ FormatStyle *Style, bool Al
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
+ auto diagHandlerOrDropHandling =
+ DiagH
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
+ auto diagHandlerOrDropHandling =
+ DiagH
pointhex wrote:
> Can you call `parseConfiguration()` instead of `getStyle()` in QtCreator
> while the user is entering code? It seems inefficient to call `getStyle()`
> all the time.
I do it in the places where I can use parseConfiguration instead. But in some
cases I need getStyle and it's
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
+ auto diagHandlerOrDropHandling =
+ DiagH
https://github.com/owenca commented:
Can you call `parseConfiguration()` instead of `getStyle()` in QtCreator while
the user is entering code? It seems inefficient to call `getStyle()` all the
time.
https://github.com/llvm/llvm-project/pull/91317
___
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mydeveloperday wrote:
I also think we need @owenca opinion
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mydeveloperday commented:
I don't have a major issue, but I think it needs a unit test otherwise we might
forget how you are using it.
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.ll
https://github.com/HazardyKnusperkeks approved this pull request.
Now that I see you want to incorporate it into QtCreator I'm even more in favor
of adding it. ;)
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits
pointhex wrote:
Done: https://github.com/llvm/llvm-project/issues/94205
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mydeveloperday edited
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
31 matches
Mail list logo