1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
/*
SPDX-FileCopyrightText: 2016 Sven Brauch <mail@svenbrauch.de>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#ifndef PYTHONSTYLECHECKING_H
#define PYTHONSTYLECHECKING_H
#include <QObject>
#include <QProcess>
#include <KConfig>
#include <KConfigGroup>
#include <language/duchain/topducontext.h>
namespace Python {
class StyleChecking : public QObject
{
Q_OBJECT
public:
StyleChecking(QObject* parent=nullptr);
~StyleChecking() override;
void startChecker(const QString& text, const QString& select={},
const QString& ignore={}, const int maxLineLength=80);
public Q_SLOTS:
void updateStyleChecking(const KDevelop::ReferencedTopDUContext& top);
void addErrorsToContext(const QVector<QString>& errors);
private Q_SLOTS:
void processOutputStarted();
private:
void addSetupErrorToContext(const QString& error);
private:
QProcess m_checkerProcess;
KDevelop::ReferencedTopDUContext m_currentlyChecking;
QMutex m_mutex;
KConfigGroup m_pep8Group;
};
};
#endif // PYTHONSTYLECHECKING_H
|