CHORE: Fixed bug #4 by looping dirs and creating directories before

other loops in creation.
LANG: Added CPP and bugfixed c to use c code and not python
This commit is contained in:
2026-10-23 08:25:21 -04:00
parent b6d46a0cef
commit 1c4a61ce7f
10 changed files with 382 additions and 33 deletions
+122
View File
@@ -0,0 +1,122 @@
return {
--[[ =====================================================================
TEMPLATE: MAIN (Entrypoint)
File: main.c
Target: src/{project_name}/main.py
===================================================================== --]]
main = vim.trim([=[
#include <stdio.h>
int
main()
{
char* str = "Hello World";
printf("%s\n", str);
return 0;
}
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: INIT (Package Anchor)
File: __init__.py
Target: src/{project_name}/__init__.py
===================================================================== --]]
format = vim.trim([=[
---
BasedOnStyle: Google
Standard: Latest
UseTab: Always
TabWidth: 8
IndentWidth: 8
BreakBeforeBraces: Allman
SpaceBeforeCpp11BracedList: true
SeparateDefinitionBlocks: Always
Cpp11BracedListStyle: false
BreakAfterReturnType: TopLevel
ReflowComments: Always
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: true
IndentAccessModifiers: false # Indent access specifiers by one level
AccessModifierOffset: -4 # Optional: adjust offset relative to the class indentation level
IndentGotoLabels: InnerIndent
DerivePointerAlignment: false
PointerAlignment: Left
IndentPPDirectives: AfterHash
SortIncludes: CaseSensitive
IncludeBlocks: Preserve
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: PYPROJECT (Spec / Build Manifest)
File: pyproject.toml
Target: pyproject.toml
===================================================================== --]]
CmakeLists = vim.trim([=[
cmake_minimum_required(VERSION 3.16)
project(__PROJECT_NAME__ LANGUAGES C)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_library(__PROJECT_NAME__ STATIC
# Add your other types here as you implement them:
# src/example1.c
# src/example2.c
)
target_include_directories(__PROJECT_NAME__
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
add_executable(__PROJECT_NAME___bin src/main.c)
set_target_properties(__PROJECT_NAME___bin PROPERTIES OUTPUT_NAME "__PROJECT_NAME__")
target_link_libraries(__PROJECT_NAME___bin PRIVATE __PROJECT_NAME__)
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: MODULE (Standalone File)
File: {name}.py
Target: src/{project_name}/{name}.py
===================================================================== --]]
header = vim.trim([=[
#ifndef __PROJECT_NAME___H
#define __PROJECT_NAME___H
// Code
#endif /* __PROJECT_NAME___H */
]=]) .. "\n",
source = vim.trim([=[
]=]) .. "\n",
linter = vim.trim([=[
Checks: >
-*,
clang-analyzer-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-reserved-identifier,
performance-*,
security-*
readability-redundant-declaration
readability-misleading-indentation
readability-implicit-bool-conversion
misc-misplaced-const,
misc-include-cleaner
-bugprone-narrowing-conversions,
-readability-identifier-length
CheckOptions:
readability-identifier-naming.VariableCase: lower_case
readability-identifier-naming.FunctionCase: lower_case
readability-identifier-naming.StructCase: lower_case
readability-identifier-naming.EnumCase: CamelCase
readability-identifier-naming.EnumConstantCase: UPPER_CASE
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
]=]) .. "\n",
}