From 8e55a0b43fa97171c7fc2b2ed72f8218e5dcde1b Mon Sep 17 00:00:00 2001 From: Menno van der Graaf Date: Wed, 23 Oct 2024 18:14:15 +0200 Subject: [PATCH] Bump linters and fix linter errors --- .pre-commit-config.yaml | 13 ++++++++----- README.md | 2 +- service/animation_runner/animation_runner.cpp | 2 +- service/animation_runner/animation_runner.hpp | 2 -- service/animation_runner/screen_interface_js.cpp | 8 ++++---- service/animation_runner/screen_interface_js.hpp | 6 +++--- .../tests/animation_runner_test.cpp | 6 ++++-- service/http_server/http_server.cpp | 1 + service/main.cpp | 3 ++- service/screen/demo/main.cpp | 1 + service/screen/dummy_screen_controller.cpp | 3 ++- service/screen/screen_controller.cpp | 3 ++- service/screen/screen_controller_interface.hpp | 4 ++-- service/scripts_cache/script.cpp | 1 - service/scripts_cache/scripts_cache.cpp | 1 + service/signal_monitor/signal_monitor.hpp | 4 ++-- 16 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c15268e..8e896a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v5.0.0 hooks: - id: check-merge-conflict - id: check-added-large-files @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.31.1 + rev: v0.42.0 hooks: - id: markdownlint args: [--disable=MD013] @@ -25,8 +25,11 @@ repos: # - id: clang-tidy # - id: cppcheck -- repo: https://github.com/bmorcos/pre-commit-hooks-cpp - rev: 9a5aa38207bf557961110d6a4f7e3a9d352911f9 +- repo: https://github.com/cpplint/cpplint + rev: 2.0.0 hooks: - id: cpplint - args: [--filter=-legal/copyright] + # Disabled rules: + # - legal/copyright: I don't care about copyright headers in my opensource code + # - whitespace/indent_namespace: Many false positives about continuation indentation inside namespaces. + args: ["--filter=-legal/copyright,-whitespace/indent_namespace"] diff --git a/README.md b/README.md index 303cac9..2486592 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ class Animation { } ``` -## Dependencies: +## Dependencies The API backend in written in Qt, because it has a nice and easy to use Javascript engine 🤷. diff --git a/service/animation_runner/animation_runner.cpp b/service/animation_runner/animation_runner.cpp index b111fbc..e6882c3 100644 --- a/service/animation_runner/animation_runner.cpp +++ b/service/animation_runner/animation_runner.cpp @@ -1,11 +1,11 @@ #include "animation_runner/animation_runner.hpp" #include -#include #include #include #include #include +#include #include Q_LOGGING_CATEGORY(AnimationRunnerLog, "animation.runner", QtInfoMsg) diff --git a/service/animation_runner/animation_runner.hpp b/service/animation_runner/animation_runner.hpp index 59e3974..3775079 100644 --- a/service/animation_runner/animation_runner.hpp +++ b/service/animation_runner/animation_runner.hpp @@ -1,8 +1,6 @@ #pragma once #include -#include -#include #include #include #include diff --git a/service/animation_runner/screen_interface_js.cpp b/service/animation_runner/screen_interface_js.cpp index f67d534..1b1325a 100644 --- a/service/animation_runner/screen_interface_js.cpp +++ b/service/animation_runner/screen_interface_js.cpp @@ -1,9 +1,9 @@ #include "animation_runner/screen_interface_js.hpp" -#include -#include -#include -#include +#include +#include +#include +#include #include Q_LOGGING_CATEGORY(ScreenInterfaceLog, "animation.screeninterface", QtInfoMsg) diff --git a/service/animation_runner/screen_interface_js.hpp b/service/animation_runner/screen_interface_js.hpp index 2de0979..8fb837e 100644 --- a/service/animation_runner/screen_interface_js.hpp +++ b/service/animation_runner/screen_interface_js.hpp @@ -1,8 +1,8 @@ #pragma once -#include -#include -#include +#include +#include +#include #include class ScreenInterfaceJs : public QObject { diff --git a/service/animation_runner/tests/animation_runner_test.cpp b/service/animation_runner/tests/animation_runner_test.cpp index 3184240..27d6ca9 100644 --- a/service/animation_runner/tests/animation_runner_test.cpp +++ b/service/animation_runner/tests/animation_runner_test.cpp @@ -1,7 +1,9 @@ #include "animation_runner/animation_runner.hpp" -#include -#include +#include +#include +#include +#include #include "animation_runner/tests/screen_controller_mock.hpp" #include "gmock/gmock.h" diff --git a/service/http_server/http_server.cpp b/service/http_server/http_server.cpp index 166ddec..4621a33 100644 --- a/service/http_server/http_server.cpp +++ b/service/http_server/http_server.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include diff --git a/service/main.cpp b/service/main.cpp index f5d4b37..e750847 100644 --- a/service/main.cpp +++ b/service/main.cpp @@ -1,6 +1,7 @@ #include #include -#include +#include +#include #include "animation_runner/animation_runner.hpp" #include "animation_runner/animation_thread.hpp" diff --git a/service/screen/demo/main.cpp b/service/screen/demo/main.cpp index 60b3a89..0a49413 100644 --- a/service/screen/demo/main.cpp +++ b/service/screen/demo/main.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "screen/demo/user_interface.hpp" #include "screen/screen_controller.hpp" diff --git a/service/screen/dummy_screen_controller.cpp b/service/screen/dummy_screen_controller.cpp index cf349a5..2f026be 100644 --- a/service/screen/dummy_screen_controller.cpp +++ b/service/screen/dummy_screen_controller.cpp @@ -1,6 +1,7 @@ #include "screen/dummy_screen_controller.hpp" -#include +#include +#include namespace { constexpr int kScreenWidth = 8; diff --git a/service/screen/screen_controller.cpp b/service/screen/screen_controller.cpp index 39bd2be..7b5d088 100644 --- a/service/screen/screen_controller.cpp +++ b/service/screen/screen_controller.cpp @@ -1,6 +1,7 @@ #include "screen/screen_controller.hpp" -#include +#include +#include #include "thirdparty/rpi_ws281x/ws2811.h" diff --git a/service/screen/screen_controller_interface.hpp b/service/screen/screen_controller_interface.hpp index 6f8d49a..54256cc 100644 --- a/service/screen/screen_controller_interface.hpp +++ b/service/screen/screen_controller_interface.hpp @@ -1,7 +1,7 @@ #pragma once -#include -#include +#include +#include #include class ScreenControllerInterface { diff --git a/service/scripts_cache/script.cpp b/service/scripts_cache/script.cpp index 3aa3108..6a0e7ef 100644 --- a/service/scripts_cache/script.cpp +++ b/service/scripts_cache/script.cpp @@ -2,7 +2,6 @@ #include #include -#include Script::Script(ScriptName name, ScriptCode code, std::unordered_set types) diff --git a/service/scripts_cache/scripts_cache.cpp b/service/scripts_cache/scripts_cache.cpp index 60d7319..afdf454 100644 --- a/service/scripts_cache/scripts_cache.cpp +++ b/service/scripts_cache/scripts_cache.cpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace { constexpr auto kDefaultSaveFile = "./animations.json"; diff --git a/service/signal_monitor/signal_monitor.hpp b/service/signal_monitor/signal_monitor.hpp index 96f8dd2..cdc7259 100644 --- a/service/signal_monitor/signal_monitor.hpp +++ b/service/signal_monitor/signal_monitor.hpp @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include +#include #include class SignalMonitor : public QObject {