ClangFormat: Allow unknown options in .clang-format file

This commit disables syntax checks for the .clang-format file,
enabling its use even if it contains errors.
Removed pop-up shown when save .clang-format file with
errors but left warning when editing it in Code Style Tab.

Fixes: QTCREATORBUG-30087
Change-Id: I37a0b1e9d602fcbe4fbbc27f7ab190bcd5c1a1fd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2024-06-03 15:55:29 +02:00
parent 09fdd9ad9e
commit c49ec17d01
5 changed files with 17 additions and 38 deletions

View File

@@ -256,8 +256,8 @@ void ClangFormatGlobalConfigWidget::initCurrentProjectLabel()
bool ClangFormatGlobalConfigWidget::projectClangFormatFileExists()
{
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder
= clang::format::getStyle("file", m_project->projectFilePath().path().toStdString(), "none");
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder = clang::format::getStyle(
"file", m_project->projectFilePath().path().toStdString(), "none", "", nullptr, true);
return styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle());
}