2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2019 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2019-10-21 14:59:57 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-08-12 09:19:55 +02:00
|
|
|
#include <utils/filepath.h>
|
2020-05-29 15:46:26 +02:00
|
|
|
|
2021-09-08 12:08:55 +02:00
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <QHash>
|
2020-05-29 15:46:26 +02:00
|
|
|
#include <QPair>
|
2019-10-21 14:59:57 +02:00
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QVector>
|
2021-07-26 15:42:28 +02:00
|
|
|
#include <QVersionNumber>
|
2019-10-21 14:59:57 +02:00
|
|
|
|
|
|
|
|
namespace ClangTools {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2020-08-24 10:46:58 +02:00
|
|
|
QPair<Utils::FilePath, QString> getClangIncludeDirAndVersion(const Utils::FilePath &clangToolPath);
|
2020-05-29 15:46:26 +02:00
|
|
|
|
2021-06-24 16:13:14 +02:00
|
|
|
enum class QueryFailMode{ Silent, Noisy };
|
|
|
|
|
QString queryVersion(const Utils::FilePath &clangToolPath, QueryFailMode failMode);
|
|
|
|
|
|
2019-10-21 14:59:57 +02:00
|
|
|
class ClangTidyInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-08-12 09:19:55 +02:00
|
|
|
ClangTidyInfo(const Utils::FilePath &executablePath);
|
2019-10-21 14:59:57 +02:00
|
|
|
QStringList defaultChecks;
|
|
|
|
|
QStringList supportedChecks;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ClazyCheck
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString name;
|
|
|
|
|
int level;
|
|
|
|
|
QStringList topics;
|
|
|
|
|
};
|
|
|
|
|
using ClazyChecks = QVector<ClazyCheck>;
|
|
|
|
|
|
|
|
|
|
class ClazyStandaloneInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-09-13 15:36:51 +02:00
|
|
|
static ClazyStandaloneInfo getInfo(const Utils::FilePath &executablePath);
|
2021-07-26 15:42:28 +02:00
|
|
|
|
|
|
|
|
QVersionNumber version;
|
2019-10-21 14:59:57 +02:00
|
|
|
QStringList defaultChecks;
|
|
|
|
|
ClazyChecks supportedChecks;
|
2021-09-08 12:08:55 +02:00
|
|
|
|
|
|
|
|
private:
|
2021-09-13 15:36:51 +02:00
|
|
|
ClazyStandaloneInfo(const Utils::FilePath &executablePath);
|
2021-09-08 12:08:55 +02:00
|
|
|
|
|
|
|
|
static QHash<Utils::FilePath, QPair<QDateTime, ClazyStandaloneInfo>> cache;
|
2019-10-21 14:59:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClangTools
|
|
|
|
|
|