From e0cbc48cc042e601cf1468eee97e87b1dfd7a7b4 Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Sat, 7 Mar 2026 13:44:13 -0500 Subject: [PATCH] c/c++ changes --- lua/Polydev/templates.lua | 54 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/lua/Polydev/templates.lua b/lua/Polydev/templates.lua index 7a9bf2d..839ef9a 100644 --- a/lua/Polydev/templates.lua +++ b/lua/Polydev/templates.lua @@ -6,9 +6,12 @@ local function extras(guard, file_type, file_name) if not file_name then return print("Header file creation canceled") end local guard_macro = file_name:upper():gsub("[^A-Z0-9]", "_") .. guard local content = string.format([[ -#praga once +#ifndef %s +#define %s + // Add code here +#endif ]], guard_macro, guard_macro) utils.write_file({ utils.get_project_root(), "include", file_name .. file_type }, content) end @@ -116,6 +119,30 @@ int main() { return 0; } ]]) + + utils.write_file({ full_project_root, ".clang-tidy" }, string.format([[ +--- +Checks: > + -*, + bugprone-*, + concurrency-*, + misc-*, + modernize-*, + performance-*, + readability-*, + portability-*, + -readability-braces-around-statements, + -readability-implicit-bool-conversion + +WarningsAsErrors: "" + +CheckOptions: + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.FunctionCase + value: lower_case +--- + ]])) utils.write_file({ full_project_root, "CMakeLists.txt" }, string.format([[ cmake_minimum_required(VERSION 3.16) set(CMAKE_C_STANDARD 23) @@ -172,6 +199,31 @@ int main() { return 0; } ]]) + + utils.write_file({ full_project_root, ".clang-tidy" }, string.format([[ +--- +Checks: > + -*, + bugprone-*, + concurrency-*, + misc-*, + modernize-*, + performance-*, + readability-*, + portability-*, + -readability-braces-around-statements, + -readability-implicit-bool-conversion + +WarningsAsErrors: "" + +CheckOptions: + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.FunctionCase + value: lower_case +--- + ]])) + utils.write_file({ full_project_root, "CMakeLists.txt" }, string.format([[ cmake_minimum_required(VERSION 3.16) set(CMAKE_CXX_STANDARD 23)