CHORE: Bug fixed c and cpp files and fixed their templates. Bug #3 is

also done
This commit is contained in:
2026-10-23 09:30:37 -04:00
parent 1c4a61ce7f
commit 4bf705df03
5 changed files with 76 additions and 44 deletions
+21 -11
View File
@@ -2,7 +2,7 @@ return {
--[[ =====================================================================
TEMPLATE: MAIN (Entrypoint)
File: main.c
Target: src/{project_name}/main.py
Target: src/main.c
===================================================================== --]]
main = vim.trim([=[
#include <stdio.h>
@@ -17,9 +17,9 @@ main()
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: INIT (Package Anchor)
File: __init__.py
Target: src/{project_name}/__init__.py
TEMPLATE: CLANG-FORMAT (Code formatter)
File: .clang-format
Target: .clang-format
===================================================================== --]]
format = vim.trim([=[
---
@@ -48,9 +48,9 @@ IncludeBlocks: Preserve
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: PYPROJECT (Spec / Build Manifest)
File: pyproject.toml
Target: pyproject.toml
TEMPLATE: CMAKELISTS (Spec / Build Manifest)
File: CMakeLists.txt
Target: CMakeLists.txt
===================================================================== --]]
CmakeLists = vim.trim([=[
cmake_minimum_required(VERSION 3.16)
@@ -67,7 +67,7 @@ set(LIB_SOURCES
if(LIB_SOURCES)
add_library(__PROJECT_NAME__ STATIC ${LIB_SOURCES})
target_include_directories(%s
target_include_directories(__PROJECT_NAME__
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
@@ -82,9 +82,9 @@ endif()
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: MODULE (Standalone File)
File: {name}.py
Target: src/{project_name}/{name}.py
TEMPLATE: HEADER (Standalone File)
File: {name}.h
Target: include/{project_name}/{name}.h
===================================================================== --]]
header = vim.trim([=[
#ifndef __PROJECT_NAME___H
@@ -95,9 +95,19 @@ endif()
#endif /* __PROJECT_NAME___H */
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: SOURCE (Standalone File)
File: {name}.c
Target: src/{name}.c
===================================================================== --]]
source = vim.trim([=[
]=]) .. "\n",
--[[ =====================================================================
TEMPLATE: CLANG_TIDY (LINTER)
File: .clang-tidy
Target: .clang-tidy
===================================================================== --]]
linter = vim.trim([=[
Checks: >
-*,