forked from qt-creator/qt-creator
ClangTools: Get rid of OutputFileFormat enum
This enum contains only one value now, so it's no-op.
Amends 9fc2fda07e
Change-Id: Ifa144dafb6155db93c06e3faecc40e38e464dac0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "clangtidyclazyrunner.h"
|
#include "clangtidyclazyrunner.h"
|
||||||
|
|
||||||
#include "clangtoolssettings.h"
|
|
||||||
#include "clangtoolsutils.h"
|
#include "clangtoolsutils.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -16,7 +15,6 @@
|
|||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runner", QtWarningMsg)
|
static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runner", QtWarningMsg)
|
||||||
@@ -69,7 +67,6 @@ ClangTidyRunner::ClangTidyRunner(const ClangDiagnosticConfig &config, QObject *p
|
|||||||
: ClangToolRunner(parent)
|
: ClangToolRunner(parent)
|
||||||
{
|
{
|
||||||
setName(tr("Clang-Tidy"));
|
setName(tr("Clang-Tidy"));
|
||||||
setOutputFileFormat(OutputFileFormat::Yaml);
|
|
||||||
setExecutable(clangTidyExecutable());
|
setExecutable(clangTidyExecutable());
|
||||||
setArgsCreator([this, config](const QStringList &baseOptions) {
|
setArgsCreator([this, config](const QStringList &baseOptions) {
|
||||||
return QStringList() << tidyChecksArguments(config)
|
return QStringList() << tidyChecksArguments(config)
|
||||||
@@ -83,7 +80,6 @@ ClazyStandaloneRunner::ClazyStandaloneRunner(const ClangDiagnosticConfig &config
|
|||||||
: ClangToolRunner(parent)
|
: ClangToolRunner(parent)
|
||||||
{
|
{
|
||||||
setName(tr("Clazy"));
|
setName(tr("Clazy"));
|
||||||
setOutputFileFormat(OutputFileFormat::Yaml);
|
|
||||||
setExecutable(clazyStandaloneExecutable());
|
setExecutable(clazyStandaloneExecutable());
|
||||||
setArgsCreator([this, config](const QStringList &baseOptions) {
|
setArgsCreator([this, config](const QStringList &baseOptions) {
|
||||||
return QStringList() << clazyChecksArguments(config)
|
return QStringList() << clazyChecksArguments(config)
|
||||||
|
@@ -51,10 +51,8 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSortFilterProxyModel>
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -681,22 +679,15 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection,
|
|||||||
ProjectExplorerPlugin::startRunControl(m_runControl);
|
ProjectExplorerPlugin::startRunControl(m_runControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
Diagnostics ClangTool::read(OutputFileFormat outputFileFormat,
|
Diagnostics ClangTool::read(const QString &logFilePath,
|
||||||
const QString &logFilePath,
|
|
||||||
const QSet<FilePath> &projectFiles,
|
const QSet<FilePath> &projectFiles,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
const auto acceptFromFilePath = [projectFiles](const Utils::FilePath &filePath) {
|
const auto acceptFromFilePath = [projectFiles](const Utils::FilePath &filePath) {
|
||||||
return projectFiles.contains(filePath);
|
return projectFiles.contains(filePath);
|
||||||
};
|
};
|
||||||
|
return readExportedDiagnostics(Utils::FilePath::fromString(logFilePath),
|
||||||
if (outputFileFormat == OutputFileFormat::Yaml) {
|
acceptFromFilePath, errorMessage);
|
||||||
return readExportedDiagnostics(Utils::FilePath::fromString(logFilePath),
|
|
||||||
acceptFromFilePath,
|
|
||||||
errorMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileInfos ClangTool::collectFileInfos(Project *project, FileSelection fileSelection)
|
FileInfos ClangTool::collectFileInfos(Project *project, FileSelection fileSelection)
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
#include "clangfileinfo.h"
|
#include "clangfileinfo.h"
|
||||||
#include "clangtoolsdiagnostic.h"
|
#include "clangtoolsdiagnostic.h"
|
||||||
#include "clangtoolsdiagnosticmodel.h"
|
#include "clangtoolsdiagnosticmodel.h"
|
||||||
#include "clangtoolslogfilereader.h"
|
|
||||||
|
|
||||||
#include <debugger/debuggermainwindow.h>
|
#include <debugger/debuggermainwindow.h>
|
||||||
|
|
||||||
@@ -66,8 +65,7 @@ public:
|
|||||||
const RunSettings &runSettings,
|
const RunSettings &runSettings,
|
||||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig);
|
const CppEditor::ClangDiagnosticConfig &diagnosticConfig);
|
||||||
|
|
||||||
Diagnostics read(OutputFileFormat outputFileFormat,
|
Diagnostics read(const QString &logFilePath,
|
||||||
const QString &logFilePath,
|
|
||||||
const QSet<Utils::FilePath> &projectFiles,
|
const QSet<Utils::FilePath> &projectFiles,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|
||||||
|
@@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
#include "clangtidyclazyrunner.h"
|
#include "clangtidyclazyrunner.h"
|
||||||
#include "clangtool.h"
|
#include "clangtool.h"
|
||||||
#include "clangtoolslogfilereader.h"
|
|
||||||
#include "clangtoolsprojectsettings.h"
|
|
||||||
#include "clangtoolssettings.h"
|
#include "clangtoolssettings.h"
|
||||||
#include "clangtoolsutils.h"
|
#include "clangtoolsutils.h"
|
||||||
#include "executableinfo.h"
|
#include "executableinfo.h"
|
||||||
@@ -323,10 +321,7 @@ void ClangToolRunWorker::onRunnerFinishedWithSuccess(ClangToolRunner *runner,
|
|||||||
emit runnerFinished();
|
emit runnerFinished();
|
||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
const Diagnostics diagnostics = m_tool->read(runner->outputFileFormat(),
|
const Diagnostics diagnostics = m_tool->read(outputFilePath, m_projectFiles, &errorMessage);
|
||||||
outputFilePath,
|
|
||||||
m_projectFiles,
|
|
||||||
&errorMessage);
|
|
||||||
|
|
||||||
if (!errorMessage.isEmpty()) {
|
if (!errorMessage.isEmpty()) {
|
||||||
m_filesAnalyzed.remove(filePath);
|
m_filesAnalyzed.remove(filePath);
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "clangtoolslogfilereader.h"
|
|
||||||
|
|
||||||
#include <utils/commandline.h>
|
#include <utils/commandline.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
@@ -26,12 +24,10 @@ public:
|
|||||||
void setName(const QString &name) { m_name = name; }
|
void setName(const QString &name) { m_name = name; }
|
||||||
void setExecutable(const Utils::FilePath &executable) { m_executable = executable; }
|
void setExecutable(const Utils::FilePath &executable) { m_executable = executable; }
|
||||||
void setArgsCreator(const ArgsCreator &argsCreator) { m_argsCreator = argsCreator; }
|
void setArgsCreator(const ArgsCreator &argsCreator) { m_argsCreator = argsCreator; }
|
||||||
void setOutputFileFormat(const OutputFileFormat &format) { m_outputFileFormat = format; }
|
|
||||||
void setVFSOverlay(const QString overlayFilePath) { m_overlayFilePath = overlayFilePath; }
|
void setVFSOverlay(const QString overlayFilePath) { m_overlayFilePath = overlayFilePath; }
|
||||||
|
|
||||||
QString name() const { return m_name; }
|
QString name() const { return m_name; }
|
||||||
Utils::FilePath executable() const { return m_executable; }
|
Utils::FilePath executable() const { return m_executable; }
|
||||||
OutputFileFormat outputFileFormat() const { return m_outputFileFormat; }
|
|
||||||
QString fileToAnalyze() const { return m_fileToAnalyze; }
|
QString fileToAnalyze() const { return m_fileToAnalyze; }
|
||||||
QString outputFilePath() const { return m_outputFilePath; }
|
QString outputFilePath() const { return m_outputFilePath; }
|
||||||
QStringList mainToolArguments() const;
|
QStringList mainToolArguments() const;
|
||||||
@@ -62,7 +58,6 @@ private:
|
|||||||
QString m_name;
|
QString m_name;
|
||||||
Utils::FilePath m_executable;
|
Utils::FilePath m_executable;
|
||||||
ArgsCreator m_argsCreator;
|
ArgsCreator m_argsCreator;
|
||||||
OutputFileFormat m_outputFileFormat = OutputFileFormat::Yaml;
|
|
||||||
|
|
||||||
QString m_fileToAnalyze;
|
QString m_fileToAnalyze;
|
||||||
QString m_outputFilePath;
|
QString m_outputFilePath;
|
||||||
|
@@ -13,8 +13,6 @@ namespace Utils { class FilePath; }
|
|||||||
namespace ClangTools {
|
namespace ClangTools {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
enum class OutputFileFormat { Yaml };
|
|
||||||
|
|
||||||
using AcceptDiagsFromFilePath = std::function<bool(const Utils::FilePath &)>;
|
using AcceptDiagsFromFilePath = std::function<bool(const Utils::FilePath &)>;
|
||||||
|
|
||||||
// Reads diagnostics generated by "clang-tidy/clazy-standalone -export-fixes=path/to/file"
|
// Reads diagnostics generated by "clang-tidy/clazy-standalone -export-fixes=path/to/file"
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "clangtidyclazyrunner.h"
|
#include "clangtidyclazyrunner.h"
|
||||||
#include "clangtoolruncontrol.h"
|
#include "clangtoolruncontrol.h"
|
||||||
#include "clangtoolsconstants.h"
|
#include "clangtoolsconstants.h"
|
||||||
|
#include "clangtoolslogfilereader.h"
|
||||||
#include "clangtoolsprojectsettings.h"
|
#include "clangtoolsprojectsettings.h"
|
||||||
#include "clangtoolsutils.h"
|
#include "clangtoolsutils.h"
|
||||||
#include "diagnosticmark.h"
|
#include "diagnosticmark.h"
|
||||||
|
Reference in New Issue
Block a user