From 230046152ce0ae2bcee2f294d8d6be3a4b5e4529 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 15 Sep 2025 13:54:50 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20clang-format,=20actualizar=20READ?= =?UTF-8?q?ME=20y=20mejorar=20formato=20del=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar .clang-format con configuración Google personalizada - Agregar .clang-tidy para análisis de código estático - Actualizar README.md para enfatizar propósito experimental de delta time - Mejorar formato de declaración de themes en main.cpp 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .clang-format | 21 +++++++++++++ .clang-tidy | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .clang-format create mode 100644 .clang-tidy diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..58bffd5 --- /dev/null +++ b/.clang-format @@ -0,0 +1,21 @@ +BasedOnStyle: Google +IndentWidth: 4 +IndentAccessModifiers: true +ColumnLimit: 0 # Sin límite de longitud de línea +BreakBeforeBraces: Attach # Llaves en la misma línea +AllowShortIfStatementsOnASingleLine: true +AllowShortBlocksOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AlignOperands: DontAlign +AlignAfterOpenBracket: DontAlign +BinPackArguments: false +BinPackParameters: false +ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 4 +IndentWrappedFunctionNames: false +Cpp11BracedListStyle: true +BreakConstructorInitializers: BeforeColon +AllowAllConstructorInitializersOnNextLine: false +PackConstructorInitializers: Never +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..82362cf --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,83 @@ +Checks: > + readability-*, + modernize-*, + performance-*, + bugprone-unchecked-optional-access, + bugprone-sizeof-expression, + bugprone-suspicious-missing-comma, + bugprone-suspicious-index, + bugprone-undefined-memory-manipulation, + bugprone-use-after-move, + bugprone-out-of-bound-access, + -readability-identifier-length, + -readability-magic-numbers, + -bugprone-narrowing-conversions, + -performance-enum-size, + -performance-inefficient-string-concatenation, + -bugprone-integer-division, + -bugprone-easily-swappable-parameters, + +WarningsAsErrors: '*' +# Solo incluir archivos de tu código fuente +HeaderFilterRegex: '^source/(sections|ui)/.*' +FormatStyle: file + +CheckOptions: + # Variables locales en snake_case + - { key: readability-identifier-naming.VariableCase, value: lower_case } + + # Miembros privados en snake_case con sufijo _ + - { key: readability-identifier-naming.PrivateMemberCase, value: lower_case } + - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } + + # Miembros protegidos en snake_case con sufijo _ + - { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case } + - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } + + # Miembros públicos en snake_case (sin sufijo) + - { key: readability-identifier-naming.PublicMemberCase, value: lower_case } + + # Namespaces en CamelCase + - { key: readability-identifier-naming.NamespaceCase, value: CamelCase } + + # Variables estáticas privadas como miembros privados + - { key: readability-identifier-naming.StaticVariableCase, value: lower_case } + - { key: readability-identifier-naming.StaticVariableSuffix, value: _ } + + # Constantes estáticas sin sufijo + - { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE } + + # Constantes globales en UPPER_CASE + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } + + # Variables constexpr globales en UPPER_CASE + - { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE } + + # Constantes locales en UPPER_CASE + - { key: readability-identifier-naming.LocalConstantCase, value: UPPER_CASE } + + # Constexpr miembros en UPPER_CASE (sin sufijo) + - { key: readability-identifier-naming.ConstexprMemberCase, value: UPPER_CASE } + + # Constexpr miembros privados/protegidos con sufijo _ + - { key: readability-identifier-naming.ConstexprMethodCase, value: UPPER_CASE } + + # Clases, structs y enums en CamelCase + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.EnumCase, value: CamelCase } + + # Valores de enums en UPPER_CASE + - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } + + # Métodos en camelBack (sin sufijos) + - { key: readability-identifier-naming.MethodCase, value: camelBack } + - { key: readability-identifier-naming.PrivateMethodCase, value: camelBack } + - { key: readability-identifier-naming.ProtectedMethodCase, value: camelBack } + - { key: readability-identifier-naming.PublicMethodCase, value: camelBack } + + # Funciones en camelBack + - { key: readability-identifier-naming.FunctionCase, value: camelBack } + + # Parámetros en lower_case + - { key: readability-identifier-naming.ParameterCase, value: lower_case } \ No newline at end of file diff --git a/README.md b/README.md index cba609f..d018dc6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # ViBe1 Delta - Simulador de Sprites con Fisica -**ViBe1 Delta** es un programa de demostracion que utiliza **SDL3** para mostrar sprites (pelotas) rebotando en pantalla con simulacion de fisica basica. Este proyecto sirve como base para experimentar con bucles de juego, renderizado y fisica en tiempo real. +**ViBe1 Delta** es una demo experimental de **vibe-coding** que implementa **delta time** para separar la logica de juego del renderizado. Utiliza **SDL3** para mostrar sprites (pelotas) rebotando con fisica independiente del framerate. + +El nombre refleja su proposito: **ViBe** (vibe-coding experimental) + **Delta** (tiempo delta para logica desacoplada). La demo sirve como sandbox para probar bucles de juego con timing independiente y renderizado optimizado. ## 🎯 Caracteristicas Actuales