diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64a44007c..18bf2617e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: exclude: ^(3rdparty/|cmake/ECM/|cmake/KDAB/|launcher/ui/processlist.*|compat/qasconst.h|docs/api/doxygen-awesome.css|launcher/cli/completions/gammaray.zsh|ui/resources/gammaray/update_icon_sets.sh) repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -21,11 +21,11 @@ repos: - id: destroyed-symlinks - id: check-executables-have-shebangs - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.6 + rev: v19.1.1 hooks: - id: clang-format - repo: https://github.com/PyCQA/pylint - rev: v3.2.7 + rev: v3.3.1 hooks: - id: pylint exclude: ^(.cmake-format.py|conan/.*/conanfile.py) diff --git a/core/tools/objectinspector/connectionsextension.cpp b/core/tools/objectinspector/connectionsextension.cpp index e7a7dc9f9..ad3c82d58 100644 --- a/core/tools/objectinspector/connectionsextension.cpp +++ b/core/tools/objectinspector/connectionsextension.cpp @@ -26,7 +26,7 @@ using namespace GammaRay; ConnectionsExtension::ConnectionsExtension(PropertyController *controller) : ConnectionsExtensionInterface( - controller->objectBaseName() + ".connectionsExtension", controller) + controller->objectBaseName() + ".connectionsExtension", controller) , PropertyControllerExtension(controller->objectBaseName() + ".connections") { m_inboundModel = new InboundConnectionsModel(controller); diff --git a/launcher/core/injector/basicwindllinjector.cpp b/launcher/core/injector/basicwindllinjector.cpp index c8a507413..2e3f00fc1 100644 --- a/launcher/core/injector/basicwindllinjector.cpp +++ b/launcher/core/injector/basicwindllinjector.cpp @@ -28,7 +28,7 @@ do { \ } while (false) #define ERROR_CHECK(condition) ERROR_ASSERT( \ - condition, do {} while (false)); + condition, do { } while (false)); BOOL BasicWinDllInjector::addDllDirectory(HANDLE destProcess, wchar_t *dllDirPath) { diff --git a/plugins/localeinspector/localedataaccessor.cpp b/plugins/localeinspector/localedataaccessor.cpp index f3d9e5fc9..9ea2d215d 100644 --- a/plugins/localeinspector/localedataaccessor.cpp +++ b/plugins/localeinspector/localedataaccessor.cpp @@ -101,7 +101,7 @@ void LocaleDataAccessorRegistry::init() LOCALE_SIMPLE_ACCESSOR(TextDirection, return locale.textDirection() == Qt::LeftToRight ? QStringLiteral( - "LTR") + "LTR") : QStringLiteral("RTL");) LOCALE_SIMPLE_DEFAULT_ACCESSOR(TimeFormatLong, @@ -167,8 +167,7 @@ void LocaleDataAccessorRegistry::init() const auto wds = locale.weekdays(); QStringList resultList; resultList.reserve(wds.size()); - for (Qt::DayOfWeek dayNumber - : wds) { + for (Qt::DayOfWeek dayNumber : wds) { resultList << QLocale().dayName(dayNumber); } return QLocale() .createSeparatedList(resultList);) @@ -213,7 +212,7 @@ void LocaleDataAccessorRegistry::init() return locale.measurementSystem() == QLocale::ImperialSystem ? QStringLiteral( - "Imperial") + "Imperial") : QStringLiteral("Metric");) LOCALE_SIMPLE_DEFAULT_ACCESSOR(FloatFormat, diff --git a/plugins/localeinspector/localedataaccessor.h b/plugins/localeinspector/localedataaccessor.h index 02424a24e..99fb91583 100644 --- a/plugins/localeinspector/localedataaccessor.h +++ b/plugins/localeinspector/localedataaccessor.h @@ -80,7 +80,7 @@ struct LocaleDataAccessor { \ explicit Locale##NAME##Accessor(LocaleDataAccessorRegistry *registry) \ : LocaleDataAccessor( \ - registry) \ + registry) \ { \ } \ QString accessorName() override \ @@ -95,7 +95,7 @@ struct LocaleDataAccessor { \ explicit Locale##NAME##Accessor(LocaleDataAccessorRegistry *registry) \ : LocaleDataAccessor( \ - registry, true) \ + registry, true) \ { \ } \ \ diff --git a/plugins/network/networkreplywidget.cpp b/plugins/network/networkreplywidget.cpp index a7968802d..244c1fdc8 100644 --- a/plugins/network/networkreplywidget.cpp +++ b/plugins/network/networkreplywidget.cpp @@ -121,14 +121,14 @@ NetworkReplyWidget::NetworkReplyWidget(QWidget *parent) } #else - QTextCodec::ConverterState state; - QTextCodec *codec = QTextCodec::codecForName("UTF-8"); - const QString text = codec->toUnicode(response.constData(), response.size(), &state); - if (state.invalidChars > 0) { - ui->responseTextEdit->setPlainText(tr("%1: Unable to show response preview").arg(qApp->applicationName())); - } else { - ui->responseTextEdit->setPlainText(text); - } + QTextCodec::ConverterState state; + QTextCodec *codec = QTextCodec::codecForName("UTF-8"); + const QString text = codec->toUnicode(response.constData(), response.size(), &state); + if (state.invalidChars > 0) { + ui->responseTextEdit->setPlainText(tr("%1: Unable to show response preview").arg(qApp->applicationName())); + } else { + ui->responseTextEdit->setPlainText(text); + } #endif }); ui->responseTextEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); diff --git a/plugins/positioning/geopositioninfosourcefactory.cpp b/plugins/positioning/geopositioninfosourcefactory.cpp index 6a56a9cc9..53bc9ea74 100644 --- a/plugins/positioning/geopositioninfosourcefactory.cpp +++ b/plugins/positioning/geopositioninfosourcefactory.cpp @@ -69,9 +69,9 @@ QGeoPositionInfoSource *GeoPositionInfoSourceFactory::positionInfoSource(QObject const auto rData = metaData.at(rhs).toCbor(); return lData.value(QStringLiteral("Priority")).toInteger() > rData.value(QStringLiteral("Priority")).toInteger(); #else - const auto lData = metaData.at(lhs).value(QStringLiteral("MetaData")).toObject(); - const auto rData = metaData.at(rhs).value(QStringLiteral("MetaData")).toObject(); - return lData.value(QStringLiteral("Priority")).toInt() > rData.value(QStringLiteral("Priority")).toInt(); + const auto lData = metaData.at(lhs).value(QStringLiteral("MetaData")).toObject(); + const auto rData = metaData.at(rhs).value(QStringLiteral("MetaData")).toObject(); + return lData.value(QStringLiteral("Priority")).toInt() > rData.value(QStringLiteral("Priority")).toInt(); #endif }); diff --git a/plugins/quickinspector/quickinspector.cpp b/plugins/quickinspector/quickinspector.cpp index e765ea227..f578f941c 100644 --- a/plugins/quickinspector/quickinspector.cpp +++ b/plugins/quickinspector/quickinspector.cpp @@ -718,14 +718,11 @@ void QuickInspector::setSlowMode(bool slow) auto it = connections.find(window); if (it == connections.end()) { - connections.insert(window, connect( - window, &QQuickWindow::beforeRendering, this, [this, window]() { + connections.insert(window, connect(window, &QQuickWindow::beforeRendering, this, [this, window]() { auto it = connections.find(window); QUnifiedTimer::instance()->setSlowModeEnabled(m_slowDownEnabled); QObject::disconnect(it.value()); - connections.erase(it); - }, - Qt::DirectConnection)); + connections.erase(it); }, Qt::DirectConnection)); } }