c/c++ changes
This commit is contained in:
@@ -6,9 +6,12 @@ local function extras(guard, file_type, file_name)
|
|||||||
if not file_name then return print("Header file creation canceled") end
|
if not file_name then return print("Header file creation canceled") end
|
||||||
local guard_macro = file_name:upper():gsub("[^A-Z0-9]", "_") .. guard
|
local guard_macro = file_name:upper():gsub("[^A-Z0-9]", "_") .. guard
|
||||||
local content = string.format([[
|
local content = string.format([[
|
||||||
#praga once
|
#ifndef %s
|
||||||
|
#define %s
|
||||||
|
|
||||||
// Add code here
|
// Add code here
|
||||||
|
|
||||||
|
#endif
|
||||||
]], guard_macro, guard_macro)
|
]], guard_macro, guard_macro)
|
||||||
utils.write_file({ utils.get_project_root(), "include", file_name .. file_type }, content)
|
utils.write_file({ utils.get_project_root(), "include", file_name .. file_type }, content)
|
||||||
end
|
end
|
||||||
@@ -116,6 +119,30 @@ int main() {
|
|||||||
return 0;
|
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([[
|
utils.write_file({ full_project_root, "CMakeLists.txt" }, string.format([[
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
set(CMAKE_C_STANDARD 23)
|
set(CMAKE_C_STANDARD 23)
|
||||||
@@ -172,6 +199,31 @@ int main() {
|
|||||||
return 0;
|
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([[
|
utils.write_file({ full_project_root, "CMakeLists.txt" }, string.format([[
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|||||||
Reference in New Issue
Block a user