build: unifica .clang-format/.clang-tidy i exclou external/ i spv/ amb dummies
This commit is contained in:
@@ -2,8 +2,8 @@ BasedOnStyle: Google
|
|||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
NamespaceIndentation: All
|
NamespaceIndentation: All
|
||||||
IndentAccessModifiers: false
|
IndentAccessModifiers: false
|
||||||
ColumnLimit: 0 # Sin limite de longitud de linea
|
ColumnLimit: 0 # Sin límite de longitud de línea
|
||||||
BreakBeforeBraces: Attach # Llaves en la misma linea
|
BreakBeforeBraces: Attach # Llaves en la misma línea
|
||||||
AllowShortIfStatementsOnASingleLine: true
|
AllowShortIfStatementsOnASingleLine: true
|
||||||
AllowShortBlocksOnASingleLine: true
|
AllowShortBlocksOnASingleLine: true
|
||||||
AllowShortFunctionsOnASingleLine: All
|
AllowShortFunctionsOnASingleLine: All
|
||||||
|
|||||||
29
.clang-tidy
29
.clang-tidy
@@ -2,28 +2,23 @@ Checks:
|
|||||||
- readability-*
|
- readability-*
|
||||||
- modernize-*
|
- modernize-*
|
||||||
- performance-*
|
- performance-*
|
||||||
- bugprone-unchecked-optional-access
|
- bugprone-*
|
||||||
- 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-identifier-length
|
||||||
- -readability-magic-numbers
|
- -readability-magic-numbers
|
||||||
- -bugprone-narrowing-conversions
|
|
||||||
- -performance-enum-size
|
|
||||||
- -performance-inefficient-string-concatenation
|
|
||||||
- -bugprone-integer-division
|
- -bugprone-integer-division
|
||||||
- -bugprone-easily-swappable-parameters
|
- -bugprone-easily-swappable-parameters
|
||||||
|
- -bugprone-narrowing-conversions
|
||||||
- -modernize-avoid-c-arrays,-warnings-as-errors
|
- -modernize-avoid-c-arrays,-warnings-as-errors
|
||||||
|
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
# Excluye jail_audio.hpp, stb_image.h y stb_vorbis.c del analisis
|
# Solo headers del propio código fuente (external/ y spv/ tienen su propio .clang-tidy dummy)
|
||||||
HeaderFilterRegex: 'source/(?!jail_audio\.hpp|stb_image\.h|stb_vorbis\.c).*'
|
HeaderFilterRegex: 'source/.*'
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
|
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
|
# bugprone-empty-catch: aceptar catches vacíos marcados con @INTENTIONAL en un comentario
|
||||||
|
- { key: bugprone-empty-catch.IgnoreCatchWithKeywords, value: '@INTENTIONAL' }
|
||||||
|
|
||||||
# Variables locales en snake_case
|
# Variables locales en snake_case
|
||||||
- { key: readability-identifier-naming.VariableCase, value: lower_case }
|
- { key: readability-identifier-naming.VariableCase, value: lower_case }
|
||||||
|
|
||||||
@@ -35,17 +30,17 @@ CheckOptions:
|
|||||||
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
|
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
|
||||||
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
|
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
|
||||||
|
|
||||||
# Miembros publicos en snake_case (sin sufijo)
|
# Miembros públicos en snake_case (sin sufijo)
|
||||||
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case }
|
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case }
|
||||||
|
|
||||||
# Namespaces en CamelCase
|
# Namespaces en CamelCase
|
||||||
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
|
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
|
||||||
|
|
||||||
# Variables estaticas privadas como miembros privados
|
# Variables estáticas privadas como miembros privados
|
||||||
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
|
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
|
||||||
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
|
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
|
||||||
|
|
||||||
# Constantes estaticas sin sufijo
|
# Constantes estáticas sin sufijo
|
||||||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
# Constantes globales en UPPER_CASE
|
# Constantes globales en UPPER_CASE
|
||||||
@@ -71,7 +66,7 @@ CheckOptions:
|
|||||||
# Valores de enums en UPPER_CASE
|
# Valores de enums en UPPER_CASE
|
||||||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
# Metodos en camelBack (sin sufijos)
|
# Métodos en camelBack (sin sufijos)
|
||||||
- { key: readability-identifier-naming.MethodCase, value: camelBack }
|
- { key: readability-identifier-naming.MethodCase, value: camelBack }
|
||||||
- { key: readability-identifier-naming.PrivateMethodCase, value: camelBack }
|
- { key: readability-identifier-naming.PrivateMethodCase, value: camelBack }
|
||||||
- { key: readability-identifier-naming.ProtectedMethodCase, value: camelBack }
|
- { key: readability-identifier-naming.ProtectedMethodCase, value: camelBack }
|
||||||
@@ -80,5 +75,5 @@ CheckOptions:
|
|||||||
# Funciones en camelBack
|
# Funciones en camelBack
|
||||||
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||||
|
|
||||||
# Parametros en lower_case
|
# Parámetros en lower_case
|
||||||
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
|
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(coffee_crisis VERSION 1.00)
|
project(coffee_crisis VERSION 1.00)
|
||||||
|
|
||||||
|
# Tipus de build per defecte (Debug) si no se n'ha especificat cap
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Configuración de compilador para MinGW en Windows
|
# Configuración de compilador para MinGW en Windows
|
||||||
if(WIN32 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(WIN32 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
set(CMAKE_CXX_COMPILER "g++")
|
set(CMAKE_CXX_COMPILER "g++")
|
||||||
@@ -118,22 +123,14 @@ file(GLOB_RECURSE ALL_SOURCE_FILES
|
|||||||
"${CMAKE_SOURCE_DIR}/source/*.h"
|
"${CMAKE_SOURCE_DIR}/source/*.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Excluir stb_image.h y stb_vorbis.c del analisis
|
|
||||||
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
||||||
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*stb_image\\.h$")
|
|
||||||
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*stb_vorbis\\.c$")
|
|
||||||
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*jail_audio\\.hpp$")
|
|
||||||
|
|
||||||
# Excluir stb y jail_audio del formateo tambien
|
|
||||||
set(FORMAT_SOURCES ${ALL_SOURCE_FILES})
|
set(FORMAT_SOURCES ${ALL_SOURCE_FILES})
|
||||||
list(FILTER FORMAT_SOURCES EXCLUDE REGEX ".*stb_image\\.h$")
|
|
||||||
list(FILTER FORMAT_SOURCES EXCLUDE REGEX ".*stb_vorbis\\.c$")
|
|
||||||
list(FILTER FORMAT_SOURCES EXCLUDE REGEX ".*jail_audio\\.hpp$")
|
|
||||||
|
|
||||||
# Para cppcheck, pasar solo .cpp (los headers se procesan transitivamente).
|
# Para cppcheck, pasar solo .cpp (los headers se procesan transitivamente).
|
||||||
set(CPPCHECK_SOURCES ${ALL_SOURCE_FILES})
|
set(CPPCHECK_SOURCES ${ALL_SOURCE_FILES})
|
||||||
list(FILTER CPPCHECK_SOURCES INCLUDE REGEX ".*\\.cpp$")
|
list(FILTER CPPCHECK_SOURCES INCLUDE REGEX ".*\\.cpp$")
|
||||||
list(FILTER CPPCHECK_SOURCES EXCLUDE REGEX ".*stb_vorbis\\.c$")
|
list(FILTER CPPCHECK_SOURCES EXCLUDE REGEX ".*/source/external/.*")
|
||||||
|
|
||||||
# Targets de clang-tidy
|
# Targets de clang-tidy
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
|
|||||||
@@ -1009,6 +1009,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
|||||||
030000006d04000018c2000000000000,Logitech F510,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
030000006d04000018c2000000000000,Logitech F510,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
030000006d0400001fc2000000000000,Logitech F710,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
030000006d0400001fc2000000000000,Logitech F710,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||||
|
030000006d0400001ac2000004000000,Logitech Precision,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
030000006d04000018c2000000010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
|
030000006d04000018c2000000010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
03000000380700005032000000010000,Mad Catz PS3 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
03000000380700005032000000010000,Mad Catz PS3 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
03000000380700008433000000010000,Mad Catz PS3 Fightstick TE S Plus,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
03000000380700008433000000010000,Mad Catz PS3 Fightstick TE S Plus,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
#include "intro.h" // for Intro
|
#include "intro.h" // for Intro
|
||||||
#include "jail_audio.hpp" // for JA_Init
|
#include "jail_audio.hpp" // for JA_Init
|
||||||
#include "lang.h" // for Lang, MAX_LANGUAGES, ba_BA, en_UK
|
#include "lang.h" // for Lang, MAX_LANGUAGES, ba_BA, en_UK
|
||||||
#include "resource.h"
|
|
||||||
#include "resource_helper.h"
|
|
||||||
#include "logo.h" // for Logo
|
#include "logo.h" // for Logo
|
||||||
#include "mouse.hpp" // for Mouse::handleEvent, Mouse::upda...
|
#include "mouse.hpp" // for Mouse::handleEvent, Mouse::upda...
|
||||||
|
#include "resource.h"
|
||||||
|
#include "resource_helper.h"
|
||||||
#include "screen.h" // for FILTER_NEAREST, Screen, FILTER_...
|
#include "screen.h" // for FILTER_NEAREST, Screen, FILTER_...
|
||||||
#include "texture.h" // for Texture
|
#include "texture.h" // for Texture
|
||||||
#include "title.h" // for Title
|
#include "title.h" // for Title
|
||||||
|
|||||||
2
source/external/.clang-format
vendored
Normal file
2
source/external/.clang-format
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: Never
|
||||||
4
source/external/.clang-tidy
vendored
Normal file
4
source/external/.clang-tidy
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# source/external/.clang-tidy
|
||||||
|
Checks: '-*'
|
||||||
|
WarningsAsErrors: ''
|
||||||
|
HeaderFilterRegex: ''
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
#include "input.h" // for inputs_e, Input, REPEAT_TRUE, REPEAT_FALSE
|
#include "input.h" // for inputs_e, Input, REPEAT_TRUE, REPEAT_FALSE
|
||||||
#include "item.h" // for Item, ITEM_COFFEE_MACHINE, ITEM_CLOCK
|
#include "item.h" // for Item, ITEM_COFFEE_MACHINE, ITEM_CLOCK
|
||||||
#include "jail_audio.hpp" // for JA_PlaySound, JA_DeleteSound, JA_LoadSound
|
#include "jail_audio.hpp" // for JA_PlaySound, JA_DeleteSound, JA_LoadSound
|
||||||
#include "resource.h"
|
|
||||||
#include "lang.h" // for Lang
|
#include "lang.h" // for Lang
|
||||||
#include "menu.h" // for Menu
|
#include "menu.h" // for Menu
|
||||||
#include "movingsprite.h" // for MovingSprite
|
#include "movingsprite.h" // for MovingSprite
|
||||||
#include "player.h" // for Player, DEATH_COUNTER
|
#include "player.h" // for Player, DEATH_COUNTER
|
||||||
|
#include "resource.h"
|
||||||
#include "screen.h" // for Screen
|
#include "screen.h" // for Screen
|
||||||
#include "smartsprite.h" // for SmartSprite
|
#include "smartsprite.h" // for SmartSprite
|
||||||
#include "sprite.h" // for Sprite
|
#include "sprite.h" // for Sprite
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ static void installWebStandardMapping(SDL_JoystickID jid) {
|
|||||||
"guide:b16,"
|
"guide:b16,"
|
||||||
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
||||||
"platform:Emscripten",
|
"platform:Emscripten",
|
||||||
guidStr, name);
|
guidStr,
|
||||||
|
name);
|
||||||
SDL_AddGamepadMapping(mapping);
|
SDL_AddGamepadMapping(mapping);
|
||||||
#else
|
#else
|
||||||
(void)jid;
|
(void)jid;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <string.h> // Para strcpy, strlen
|
#include <string.h> // Para strcpy, strlen
|
||||||
|
|
||||||
#define STB_VORBIS_HEADER_ONLY
|
#define STB_VORBIS_HEADER_ONLY
|
||||||
#include "stb_vorbis.c"
|
#include "external/stb_vorbis.c"
|
||||||
|
|
||||||
// --- Public Enums ---
|
// --- Public Enums ---
|
||||||
enum JA_Channel_state { JA_CHANNEL_INVALID,
|
enum JA_Channel_state { JA_CHANNEL_INVALID,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Reescribiendo el código el 27/09/2022
|
|||||||
#include <SDL3/SDL_main.h>
|
#include <SDL3/SDL_main.h>
|
||||||
|
|
||||||
#include "director.h"
|
#include "director.h"
|
||||||
#include "stb_vorbis.c"
|
#include "external/stb_vorbis.c"
|
||||||
|
|
||||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) {
|
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) {
|
||||||
auto *director = new Director(argc, const_cast<const char **>(argv));
|
auto *director = new Director(argc, const_cast<const char **>(argv));
|
||||||
|
|||||||
@@ -74,4 +74,4 @@ namespace ResourceHelper {
|
|||||||
}
|
}
|
||||||
return pack_path;
|
return pack_path;
|
||||||
}
|
}
|
||||||
}
|
} // namespace ResourceHelper
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ namespace ResourceHelper {
|
|||||||
|
|
||||||
bool shouldUseResourcePack(const std::string& filepath);
|
bool shouldUseResourcePack(const std::string& filepath);
|
||||||
std::string getPackPath(const std::string& asset_path);
|
std::string getPackPath(const std::string& asset_path);
|
||||||
}
|
} // namespace ResourceHelper
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include "stb_image.h" // for stbi_failure_reason, stbi_image_free
|
#include "external/stb_image.h" // for stbi_failure_reason, stbi_image_free
|
||||||
|
|
||||||
SDL_ScaleMode Texture::currentScaleMode = SDL_SCALEMODE_NEAREST;
|
SDL_ScaleMode Texture::currentScaleMode = SDL_SCALEMODE_NEAREST;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user