From 70f2642e6d97c4a6075fd2198e770bae020b2f40 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Thu, 18 Dec 2025 22:35:46 +0100 Subject: [PATCH] feat(linter): afegir checks llvm-include-order i misc-include-cleaner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check 11: llvm-include-order (0 errors - codi ja compleix) - Check 12: misc-include-cleaner (detectar includes no usats i faltants) - Configurar IgnoreHeaders per SDL3 (genera falsos positius) - Fix: afegir a nau.hpp, enemic.hpp, bala.hpp - Fix: afegir a nau.hpp, enemic.hpp (std::cos/sin) Include order validat segons LLVM coding standards. Headers més nets i compilació més ràpida. --- .clang-tidy | 7 +++++++ source/game/entities/bala.hpp | 1 + source/game/entities/enemic.hpp | 2 ++ source/game/entities/nau.hpp | 2 ++ 4 files changed, 12 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 52500d0..29a2e09 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -31,6 +31,10 @@ Checks: - -bugprone-switch-missing-default-case # Excluido (no todos los switches necesitan default) - -bugprone-implicit-widening-of-multiplication-result # Excluido (valores pequeños, sin overflow) - -bugprone-exception-escape # Excluido (excepciones en main terminan el programa - OK) + # ✅ Check 11: llvm-include-order (validar orden de includes - 0 errores) + - llvm-include-order + # ⏳ Check 12: misc-include-cleaner (detectar includes no usados y faltantes) + - misc-include-cleaner WarningsAsErrors: '*' # No usar HeaderFilterRegex - usamos .clang-tidy local en source/core/audio/ para excluir @@ -95,3 +99,6 @@ CheckOptions: # Parámetros en lower_case - { key: readability-identifier-naming.ParameterCase, value: lower_case } + + # misc-include-cleaner: Ignorar SDL (genera falsos positivos) + - { key: misc-include-cleaner.IgnoreHeaders, value: 'SDL3/.*' } diff --git a/source/game/entities/bala.hpp b/source/game/entities/bala.hpp index fbfd122..32f0ab3 100644 --- a/source/game/entities/bala.hpp +++ b/source/game/entities/bala.hpp @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include "core/graphics/shape.hpp" diff --git a/source/game/entities/enemic.hpp b/source/game/entities/enemic.hpp index 501b5cf..5ee951a 100644 --- a/source/game/entities/enemic.hpp +++ b/source/game/entities/enemic.hpp @@ -5,6 +5,8 @@ #pragma once #include +#include +#include #include #include "core/graphics/shape.hpp" diff --git a/source/game/entities/nau.hpp b/source/game/entities/nau.hpp index 1c21ed2..1825713 100644 --- a/source/game/entities/nau.hpp +++ b/source/game/entities/nau.hpp @@ -5,6 +5,8 @@ #pragma once #include +#include +#include #include #include "core/graphics/shape.hpp"