other loops in creation. LANG: Added CPP and bugfixed c to use c code and not python
123 lines
3.5 KiB
Lua
123 lines
3.5 KiB
Lua
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",
|
|
}
|