forked from qt-creator/qt-creator
ClangTools: Query the tools for supported checks
...instead of hardcoding them for a particular version of clang-tidy/clazy. While at it, move also the tidy/clazy widgets to ClangTools as this simplifies feeding data to them. Reduce also the built-in configs to a single one using clang-tidy's and clazy's default checks as they look very reasonable and saves us some porting effort. Also, our previous built-in configs were just too numerous. Change-Id: Ib9297acb7810a940b86a23a8695530506a570394 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -42,37 +42,47 @@ namespace CppTools {
|
||||
class CPPTOOLS_EXPORT ClangDiagnosticConfig
|
||||
{
|
||||
public:
|
||||
enum class TidyMode
|
||||
{
|
||||
Disabled = 0,
|
||||
ChecksPrefixList,
|
||||
File
|
||||
};
|
||||
|
||||
Core::Id id() const;
|
||||
void setId(const Core::Id &id);
|
||||
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &displayName);
|
||||
|
||||
bool isReadOnly() const;
|
||||
void setIsReadOnly(bool isReadOnly);
|
||||
|
||||
QStringList clangOptions() const;
|
||||
void setClangOptions(const QStringList &options);
|
||||
|
||||
bool useBuildSystemWarnings() const;
|
||||
void setUseBuildSystemWarnings(bool useBuildSystemWarnings);
|
||||
|
||||
// Clang-Tidy
|
||||
enum class TidyMode
|
||||
{
|
||||
Disabled,
|
||||
ChecksPrefixList,
|
||||
File,
|
||||
Default,
|
||||
};
|
||||
TidyMode clangTidyMode() const;
|
||||
void setClangTidyMode(TidyMode mode);
|
||||
|
||||
QString clangTidyChecks() const;
|
||||
void setClangTidyChecks(const QString &checks);
|
||||
|
||||
TidyMode clangTidyMode() const;
|
||||
void setClangTidyMode(TidyMode mode);
|
||||
// Clazy
|
||||
enum class ClazyMode
|
||||
{
|
||||
Default,
|
||||
SpecifiedChecks,
|
||||
};
|
||||
ClazyMode clazyMode() const;
|
||||
void setClazyMode(const ClazyMode &clazyMode);
|
||||
|
||||
QString clazyChecks() const;
|
||||
void setClazyChecks(const QString &checks);
|
||||
|
||||
bool isReadOnly() const;
|
||||
void setIsReadOnly(bool isReadOnly);
|
||||
|
||||
bool useBuildSystemWarnings() const;
|
||||
void setUseBuildSystemWarnings(bool useBuildSystemWarnings);
|
||||
|
||||
bool operator==(const ClangDiagnosticConfig &other) const;
|
||||
bool operator!=(const ClangDiagnosticConfig &other) const;
|
||||
|
||||
@@ -83,6 +93,7 @@ private:
|
||||
TidyMode m_clangTidyMode = TidyMode::Disabled;
|
||||
QString m_clangTidyChecks;
|
||||
QString m_clazyChecks;
|
||||
ClazyMode m_clazyMode = ClazyMode::Default;
|
||||
bool m_isReadOnly = false;
|
||||
bool m_useBuildSystemWarnings = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user