diff --git a/.editorconfig b/.editorconfig index 943fa21..14ebf23 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,6 @@ indent_size = 2 [{.bashrc,.profile,.xinitrc}] indent_size = 2 + +[{*.mk, Makefile}] +indent_style = tab diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..59b2b16 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "C/{{ cookiecutter.project_name }}/doxygen-awesome-css"] + path = C/{{ cookiecutter.project_name }}/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git +[submodule "C/doxygen-awesome-css"] + path = C/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git diff --git a/C/cookiecutter.json b/C/cookiecutter.json index 4d574b7..fca62f2 100644 --- a/C/cookiecutter.json +++ b/C/cookiecutter.json @@ -11,6 +11,8 @@ "flake.nix", "flake.lock", "header.html", - "sourcelist.mk" + "sourcelist.mk", + "check_commit_msg.py", + "dockerfile" ] } diff --git a/C/hooks/post_gen_project.sh b/C/hooks/post_gen_project.sh index 0ccac44..5c6d8a4 100644 --- a/C/hooks/post_gen_project.sh +++ b/C/hooks/post_gen_project.sh @@ -1,7 +1,7 @@ #!/bin/sh -cp ../Common/{{ cookiecutter.project_name }}/* . -cp ../Common/{{ cookiecutter.project_name }}/.* . +chmod +w * -R +chmod +w .* -R mv * .. mv .* .. diff --git a/C/{{ cookiecutter.project_name }}/.editorconfig b/C/{{ cookiecutter.project_name }}/.editorconfig new file mode 100644 index 0000000..14ebf23 --- /dev/null +++ b/C/{{ cookiecutter.project_name }}/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 80 +indent_style = space +indent_size = 4 + +[{*.nix, *.lock, *.json, *.toml, *.yml}] +indent_size = 2 + +[{.bashrc,.profile,.xinitrc}] +indent_size = 2 + +[{*.mk, Makefile}] +indent_style = tab diff --git a/C/{{ cookiecutter.project_name }}/.gitignore b/C/{{ cookiecutter.project_name }}/.gitignore index 3c7e3b3..b0d6d67 100644 --- a/C/{{ cookiecutter.project_name }}/.gitignore +++ b/C/{{ cookiecutter.project_name }}/.gitignore @@ -2,6 +2,7 @@ debug check {{ cookiecutter.project_name }} +unittests # nix result* @@ -18,3 +19,4 @@ docs.pdf .build *.[aod] hook.mk +*.gocv.json.gz diff --git a/C/{{ cookiecutter.project_name }}/Doxyfile b/C/{{ cookiecutter.project_name }}/Doxyfile index 5f0458b..6519e18 100644 --- a/C/{{ cookiecutter.project_name }}/Doxyfile +++ b/C/{{ cookiecutter.project_name }}/Doxyfile @@ -201,8 +201,6 @@ HTML_FILE_EXTENSION = .html HTML_HEADER = header.html HTML_FOOTER = HTML_STYLESHEET = -HTML_EXTRA_STYLESHEET = -HTML_EXTRA_FILES = HTML_COLORSTYLE = DARK HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 @@ -222,7 +220,7 @@ DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_FEEDURL = DOCSET_BUNDLE_ID = org.doxygen.Project DOCSET_PUBLISHER_ID = org.doxygen.Publisher -DOCSET_PUBLISHER_NAME = Julien +DOCSET_PUBLISHER_NAME = Gabriel Hosquet GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = diff --git a/C/{{ cookiecutter.project_name }}/Makefile b/C/{{ cookiecutter.project_name }}/Makefile index fde1279..511b84d 100644 --- a/C/{{ cookiecutter.project_name }}/Makefile +++ b/C/{{ cookiecutter.project_name }}/Makefile @@ -35,9 +35,17 @@ _start: bundle include ./makeincludes/mk-recipes.mk +UNIT := unittests + CFLAGS_@main += -DFOO=1 -$(eval $(call mk-recipe-binary, release, SRC-OUT, )) +$(eval $(call mk-recipe-binary, {{ cookiecutter.project_name }}, SRC-OUT, )) + +test-src := $(filter-out %main.c, $(SRC-OUT)) +test-src += $(TST-OUT) +test-flags := -g3 --coverage -fprofile-arcs -iquote tests/include -lcriterion + +$(eval $(call mk-recipe-binary, unittests, test-src, $(test-flags))) debug-flags := -fanalyzer -DDEBUG=1 $(eval $(call mk-recipe-binary, debug, SRC-OUT, $(debug-flags))) @@ -46,27 +54,44 @@ check-flags := $(debug-flags) -fsanitize=address,leak,undefined $(eval $(call mk-recipe-binary, check, SRC-OUT, $(check-flags))) .PHONY: all #? all: default, build the release binary -all: $(out-release) +all: $(out-{{ cookiecutter.project_name }}) .PHONY: bundle #? bundle: build all binaries -bundle: debug check all - -.PHONY: clean -clean: #? clean: removes object files +bundle: debug check all $(UNIT) + +.PHONY: tests_run #? tests_run: build and run the unit tests +tests_run: $(UNIT) + $Q ./$(UNIT) -OP:F --full-stats + +.PHONY: cov #? cov: run the tests and generate coverage report +cov: tests_run + $Q gcovr . \ + --exclude-unreachable-branches \ + --exclude tests \ + --exclude-directories .direnv + $Q gcovr . \ + --exclude-unreachable-branches \ + --exclude tests \ + --exclude-directories .direnv \ + --txt-metric branch + +.PHONY: clean #? clean: removes object files +clean: $Q $(RM) -r $(_clean) -.PHONY: fclean -fclean: clean #? fclean: remove binaries and object files +.PHONY: fclean #? fclean: remove binaries and object files +fclean: clean $Q $(RM) -r $(_fclean) + $Q $(RM) -r *.gcov.json.gz -.PHONY: mrproper -mrproper: fclean #? mrproper: remove all generated files +.PHONY: mrproper #? mrproper: remove all generated files +mrproper: fclean $Q $(RM) -r $(BUILD_DIR) .PHONY: help help: #? help: Show this help message @ grep -P "#[?] " $(MAKEFILE_LIST) \ - | sed -E 's/.*#\? ([^:]+): (.*)/\1 "\2"/' \ + | sed -E 's/.*#\? ([^:]+): (.*)/\1 "\2"/' \ | xargs printf "%-12s: %s\n" include ./makeincludes/docs.mk @@ -75,5 +100,6 @@ include ./makeincludes/docs.mk .NOTPARALLEL: re re: fclean all #? re: rebuild the default target + include ./makeincludes/log-helper.mk -include hook.mk diff --git a/Common/{{ cookiecutter.project_name }}/check_commit_msg.py b/C/{{ cookiecutter.project_name }}/check_commit_msg.py similarity index 100% rename from Common/{{ cookiecutter.project_name }}/check_commit_msg.py rename to C/{{ cookiecutter.project_name }}/check_commit_msg.py diff --git a/Common/{{ cookiecutter.project_name }}/dockerfile b/C/{{ cookiecutter.project_name }}/dockerfile similarity index 100% rename from Common/{{ cookiecutter.project_name }}/dockerfile rename to C/{{ cookiecutter.project_name }}/dockerfile diff --git a/C/{{ cookiecutter.project_name }}/flake.lock b/C/{{ cookiecutter.project_name }}/flake.lock index 6ac0406..8009748 100644 --- a/C/{{ cookiecutter.project_name }}/flake.lock +++ b/C/{{ cookiecutter.project_name }}/flake.lock @@ -10,11 +10,11 @@ "vera-clang": "vera-clang" }, "locked": { - "lastModified": 1724506729, - "narHash": "sha256-EW73vddkccQBLLIxKqf8HaXpgqkEbNx8vsaqxQHNexk=", + "lastModified": 1736418159, + "narHash": "sha256-kHLV8HNVz8/VsMLORFCENjnZtEnL1xqjNFiMTYxxwVU=", "owner": "Sigmapitech", "repo": "cs", - "rev": "71832ebee388fb3ac4d77dba47bb9e02e649f036", + "rev": "7bdf86d307bc1a4e9aa0dedcff9a4a08339e0666", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -62,11 +62,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -98,11 +98,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702151865, - "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { @@ -112,29 +112,13 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { - "lastModified": 1721373214, - "narHash": "sha256-crpGeGQGFlnCsMyCE5eheyjzo3xo03o1FXJ2sAbm7No=", + "lastModified": 1737264083, + "narHash": "sha256-6QqSrHPN+ZD+7HuadVLuFNUaM8XnmZF3EO7QViM1b80=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "af9c15bc7a314c226d7d5d85e159f7a73e8d9fae", + "rev": "aa6ae0afa6adeb5c202a168e51eda1d3da571117", "type": "github" }, "original": { @@ -150,15 +134,14 @@ "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" + ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1737301351, + "narHash": "sha256-2UNmLCKORvdBRhPGI8Vx0b6l7M8/QBey/nHLIxOl4jE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "15a87cedeb67e3dbc8d2f7b9831990dffcf4e69f", "type": "github" }, "original": { @@ -177,11 +160,11 @@ "ruleset": { "flake": false, "locked": { - "lastModified": 1721722326, - "narHash": "sha256-smacvpspEG97jM37No/wi4RuFNR0WZOXDCmVTAnM4ds=", + "lastModified": 1736344796, + "narHash": "sha256-rgTPzLlJCdWPd21l08deC8G11teTyN54MkUYsf7Fz4Q=", "ref": "refs/heads/main", - "rev": "bbe149da23300d3570c6ba023d86ed04db7de009", - "revCount": 197, + "rev": "c95b7953770fbc7d30276ab9887dc2c95c10ace6", + "revCount": 222, "type": "git", "url": "ssh://git@github.com/Epitech/banana-coding-style-checker.git" }, @@ -226,11 +209,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1711917285, - "narHash": "sha256-xWNnPV0qpBNxrS7XnE1ARhGps+CmGY/eZ10vo2k+ucI=", + "lastModified": 1736411712, + "narHash": "sha256-7ELueG54iG59DYO18RH81SxT92giPM6iT7oXWNSu0co=", "owner": "Sigmapitech", "repo": "vera-clang", - "rev": "246aaa1634238c610d35f6051e6b5e910042ef40", + "rev": "53a602b99e1c954802d7cec8ea932d4263aea862", "type": "github" }, "original": { diff --git a/C/{{ cookiecutter.project_name }}/flake.nix b/C/{{ cookiecutter.project_name }}/flake.nix index cc4614d..cd32307 100644 --- a/C/{{ cookiecutter.project_name }}/flake.nix +++ b/C/{{ cookiecutter.project_name }}/flake.nix @@ -63,12 +63,12 @@ valgrind # tests criterion - python3Packages.gcovr + gcovr # docs doxygen # compile_commands.json bear - python3Packages.compiledb + compiledb # coding style cs-wrapped ]; diff --git a/C/{{ cookiecutter.project_name }}/hook.mk b/C/{{ cookiecutter.project_name }}/hook.mk new file mode 100644 index 0000000..93d6006 --- /dev/null +++ b/C/{{ cookiecutter.project_name }}/hook.mk @@ -0,0 +1,4 @@ +fclean: clean + $Q $(RM) -r $(_fclean) + $Q $(RM) -r *.gcov.json.gz + $Q $(RM) -r $(BUILD_DIR) diff --git a/C/{{ cookiecutter.project_name }}/sourcelist.mk b/C/{{ cookiecutter.project_name }}/sourcelist.mk index 7ec9e8e..49b3a50 100644 --- a/C/{{ cookiecutter.project_name }}/sourcelist.mk +++ b/C/{{ cookiecutter.project_name }}/sourcelist.mk @@ -3,3 +3,6 @@ VPATH := src SRC-OUT := main.c SRC-OUT += local_cflag_demo.c SRC-OUT += memory_demo.c + +VPATH += tests +TST-OUT := test_suite.c diff --git a/C/{{ cookiecutter.project_name }}/tests/test_suite.c b/C/{{ cookiecutter.project_name }}/tests/test_suite.c new file mode 100644 index 0000000..13320a6 --- /dev/null +++ b/C/{{ cookiecutter.project_name }}/tests/test_suite.c @@ -0,0 +1,6 @@ +#include + +Test(test_suite, test_case) +{ + cr_assert(1 == 1); +} diff --git a/Common/cookiecutter.json b/Common/cookiecutter.json deleted file mode 100644 index a5c90ac..0000000 --- a/Common/cookiecutter.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "project_name": "Tmp", - "_copy_without_render": [ - "check_commit_msg.py", - "dockerfile" - ] -} diff --git a/Cpp/cookiecutter.json b/Cpp/cookiecutter.json new file mode 100644 index 0000000..fca62f2 --- /dev/null +++ b/Cpp/cookiecutter.json @@ -0,0 +1,18 @@ +{ + "project_name": "Tmp", + "_copy_without_render": [ + "includes", + "makeincludes", + "nix", + "src", + "base_flags.txt", + "Doxyfile", + "ecsls.toml", + "flake.nix", + "flake.lock", + "header.html", + "sourcelist.mk", + "check_commit_msg.py", + "dockerfile" + ] +} diff --git a/Cpp/hooks/post_gen_project.sh b/Cpp/hooks/post_gen_project.sh new file mode 100644 index 0000000..5c6d8a4 --- /dev/null +++ b/Cpp/hooks/post_gen_project.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +chmod +w * -R +chmod +w .* -R + +mv * .. +mv .* .. +rm -rfv ../{{ cookiecutter.project_name }} + diff --git a/Cpp/{{ cookiecutter.project_name }}/.editorconfig b/Cpp/{{ cookiecutter.project_name }}/.editorconfig new file mode 100644 index 0000000..14ebf23 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 80 +indent_style = space +indent_size = 4 + +[{*.nix, *.lock, *.json, *.toml, *.yml}] +indent_size = 2 + +[{.bashrc,.profile,.xinitrc}] +indent_size = 2 + +[{*.mk, Makefile}] +indent_style = tab diff --git a/Cpp/{{ cookiecutter.project_name }}/.gitignore b/Cpp/{{ cookiecutter.project_name }}/.gitignore new file mode 100644 index 0000000..b0d6d67 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/.gitignore @@ -0,0 +1,22 @@ +# binaries +debug +check +{{ cookiecutter.project_name }} +unittests + +# nix +result* +.direnv + +# generated precommit +.pre-commit-config.yaml + +# docs +docs/ +docs.pdf + +# build +.build +*.[aod] +hook.mk +*.gocv.json.gz diff --git a/Cpp/{{ cookiecutter.project_name }}/Doxyfile b/Cpp/{{ cookiecutter.project_name }}/Doxyfile new file mode 100644 index 0000000..6519e18 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/Doxyfile @@ -0,0 +1,359 @@ +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Template" +PROJECT_NUMBER = 300 +PROJECT_BRIEF = "C template for Epitech" +PROJECT_LOGO = +OUTPUT_DIRECTORY = ./docs +CREATE_SUBDIRS = YES +CREATE_SUBDIRS_LEVEL = 8 +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = YES +PYTHON_DOCSTRING = YES +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = C=C++ \ + h=C++ \ + hpp=C++ \ + hxx=C++ \ + cpp=C++ \ + cxx=C++ \ + cc=C++ \ + c=C++ \ + inc=C++ \ + inl=C++ \ + tcc=C++ +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 5 +MARKDOWN_ID_STYLE = DOXYGEN +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = YES +CPP_CLI_SUPPORT = YES +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = YES +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = YES +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 0 +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_PRIV_VIRTUAL = YES +EXTRACT_PACKAGE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = SYSTEM +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES +SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = YES +FORCE_LOCAL_INCLUDES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = YES +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = YES +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES +WARN_NO_PARAMDOC = YES +WARN_IF_UNDOC_ENUM_VAL = YES +WARN_AS_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LINE_FORMAT = "at line $line of file $file" +WARN_LOGFILE = +INPUT = src/ includes/ +INPUT_ENCODING = UTF-8 +INPUT_FILE_ENCODING = +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice \ + *.mk +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +FORTRAN_COMMENT_AFTER = 72 +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +ALPHABETICAL_INDEX = YES +IGNORE_PREFIX = +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = header.html +HTML_FOOTER = +HTML_STYLESHEET = +HTML_COLORSTYLE = DARK +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \ + doxygen-awesome-css/doxygen-awesome-sidebar-only.css \ + doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css +HTML_EXTRA_FILES = doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ + doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ + doxygen-awesome-css/doxygen-awesome-tabs.js + +GENERATE_DOCSET = YES +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Gabriel Hosquet +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = YES +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = png +FORMULA_FONTSIZE = 10 +FORMULA_MACROFILE = +USE_MATHJAX = YES +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 +MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = YES +EXTERNAL_SEARCH = YES +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = +MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = ieeetr +LATEX_EMOJI_DIRECTORY = +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +GENERATE_MAN = YES +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = YES +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO +GENERATE_DOCBOOK = YES +DOCBOOK_OUTPUT = docbook +GENERATE_AUTOGEN_DEF = YES +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = NO +PERLMOD_MAKEVAR_PREFIX = +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = includes +INCLUDE_FILE_PATTERNS = *.h \ + *.hpp \ + *.hxx \ + *.hh +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = YES +CALLER_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DIR_GRAPH_MAX_DEPTH = 25 +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = YES +DOT_PATH = +DOTFILE_DIRS = +DIA_PATH = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +MSCGEN_TOOL = +MSCFILE_DIRS = +TIMESTAMP = NO diff --git a/Cpp/{{ cookiecutter.project_name }}/Makefile b/Cpp/{{ cookiecutter.project_name }}/Makefile new file mode 100644 index 0000000..6f07660 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/Makefile @@ -0,0 +1,107 @@ +BUILD_DIR ?= .build + +CC := g++ + +CFLAGS := -std=c++20 +CFLAGS += $(addprefix -iquote, $(INCDIRS)) + +CFLAGS += -MMD -MP +CFLAGS += -O2 + +ifneq ($(EXPLICIT_FLAGS),1) +CFLAGS += @base_flags.txt +else +CFLAGS += $(shell cat base_flags.txt) +endif + +LDFLAGS += -flto +LDLIBS ?= + +include ./sourcelist.mk +vpath %.cpp $(VPATH) + +# Hack to fixup the shell autocompletion by using dummy rules +auto-complete := +$(if $(auto-complete),$(error this should not happen),) + +ifdef auto-complete +# generated binaries +{{ cookiecutter.project_name }} debug check: + +# from docs.mk: +pdf docs docs-clean docs-fclean docs-re: +endif + +.PHONY: _start +_start: bundle + +include ./makeincludes/mk-recipes.mk + +UNIT := unittests + +CFLAGS_@main += -DFOO=1 + +$(eval $(call mk-recipe-binary, {{ cookiecutter.project_name }}, SRC-OUT, )) + +test-src := $(filter-out %main.cpp, $(SRC-OUT)) +test-src += $(TST-OUT) +test-flags := -g3 --coverage -fprofile-arcs -iquote tests/includes -lcriterion + +$(eval $(call mk-recipe-binary, unittests, test-src, $(test-flags))) + +debug-flags := -fanalyzer -DDEBUG=1 -g3 +$(eval $(call mk-recipe-binary, debug, SRC-OUT, $(debug-flags))) + +check-flags := $(debug-flags) -fsanitize=address,leak,undefined +$(eval $(call mk-recipe-binary, check, SRC-OUT, $(check-flags))) + +.PHONY: all #? all: default, build the release binary +all: $(out-{{ cookiecutter.project_name }}) + +.PHONY: bundle #? bundle: build all binaries +bundle: debug check all $(UNIT) + +.PHONY: tests_run #? tests_run: build and run the unit tests +tests_run: $(UNIT) + $Q ./$(UNIT) -OP:F --full-stats + +.PHONY: cov #? cov: run the tests and generate coverage report +cov: tests_run + $Q gcovr . \ + --exclude-unreachable-branches \ + --exclude tests \ + --exclude-directories .direnv + $Q gcovr . \ + --exclude-unreachable-branches \ + --exclude tests \ + --exclude-directories .direnv \ + --txt-metric branch + +.PHONY: clean #? clean: removes object files +clean: + $Q $(RM) -r $(_clean) + +.PHONY: fclean #? fclean: remove binaries and object files +fclean: clean + $Q $(RM) -r $(_fclean) + $Q $(RM) -r *.gcov.json.gz + +.PHONY: mrproper #? mrproper: remove all generated files +mrproper: fclean + $Q $(RM) -r $(BUILD_DIR) + +.PHONY: help +help: #? help: Show this help message + @ grep -P "#[?] " $(MAKEFILE_LIST) \ + | sed -E 's/.*#\? ([^:]+): (.*)/\1 "\2"/' \ + | xargs printf "%-12s: %s\n" + +include ./makeincludes/docs.mk + +.PHONY: re +.NOTPARALLEL: re +re: fclean all #? re: rebuild the default target + + +include ./makeincludes/log-helper.mk +-include hook.mk diff --git a/Cpp/{{ cookiecutter.project_name }}/base_flags.txt b/Cpp/{{ cookiecutter.project_name }}/base_flags.txt new file mode 100644 index 0000000..2d0fb51 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/base_flags.txt @@ -0,0 +1,21 @@ +-Wp,-U_FORTIFY_SOURCE +-Wformat=2 + +-Wall +-Wextra + +-Wcast-qual +-Wconversion + +-Wduplicated-branches +-Wduplicated-cond + +-fvisibility=hidden + +-Wwrite-strings +-Wstrict-aliasing=0 +-Wshadow +-Wunreachable-code + +-Werror=format-nonliteral +-Werror=return-type diff --git a/Cpp/{{ cookiecutter.project_name }}/check_commit_msg.py b/Cpp/{{ cookiecutter.project_name }}/check_commit_msg.py new file mode 100644 index 0000000..99a0762 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/check_commit_msg.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +import pathlib +import os +import sys + + +def has_correct_message(msg: str) -> bool: + print(f"Commit message:\n{msg}") + + verb, *words = msg.split() + report = { + " " in msg: "double space!", + msg.startswith(" ") or msg.endswith(" "): "leading or trailling space", + verb[0].islower(): "verb is not capitalized", + any(map(verb.endswith, {"ed", "ing", "s"})): "use imperative tense", + msg.endswith("."): "message should not end with a period", + len(words) < 2: "include at least 3 words", + }.get(True) + + if report is None: + return True + + print(report) + return False + + +def main(): + if len(sys.argv) != 2: + return os.EX_USAGE + + message = pathlib.Path(sys.argv[1]).read_text() + return not has_correct_message(message) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/Cpp/{{ cookiecutter.project_name }}/dockerfile b/Cpp/{{ cookiecutter.project_name }}/dockerfile new file mode 100644 index 0000000..f10fa3f --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/dockerfile @@ -0,0 +1,26 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/release"] diff --git a/Cpp/{{ cookiecutter.project_name }}/flake.lock b/Cpp/{{ cookiecutter.project_name }}/flake.lock new file mode 100644 index 0000000..8009748 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/flake.lock @@ -0,0 +1,228 @@ +{ + "nodes": { + "cs-flake": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "ruleset": "ruleset", + "vera-clang": "vera-clang" + }, + "locked": { + "lastModified": 1736418159, + "narHash": "sha256-kHLV8HNVz8/VsMLORFCENjnZtEnL1xqjNFiMTYxxwVU=", + "owner": "Sigmapitech", + "repo": "cs", + "rev": "7bdf86d307bc1a4e9aa0dedcff9a4a08339e0666", + "type": "github" + }, + "original": { + "owner": "Sigmapitech", + "repo": "cs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1737264083, + "narHash": "sha256-6QqSrHPN+ZD+7HuadVLuFNUaM8XnmZF3EO7QViM1b80=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aa6ae0afa6adeb5c202a168e51eda1d3da571117", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737301351, + "narHash": "sha256-2UNmLCKORvdBRhPGI8Vx0b6l7M8/QBey/nHLIxOl4jE=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "15a87cedeb67e3dbc8d2f7b9831990dffcf4e69f", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "cs-flake": "cs-flake", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks" + } + }, + "ruleset": { + "flake": false, + "locked": { + "lastModified": 1736344796, + "narHash": "sha256-rgTPzLlJCdWPd21l08deC8G11teTyN54MkUYsf7Fz4Q=", + "ref": "refs/heads/main", + "rev": "c95b7953770fbc7d30276ab9887dc2c95c10ace6", + "revCount": 222, + "type": "git", + "url": "ssh://git@github.com/Epitech/banana-coding-style-checker.git" + }, + "original": { + "type": "git", + "url": "ssh://git@github.com/Epitech/banana-coding-style-checker.git" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "vera-clang": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1736411712, + "narHash": "sha256-7ELueG54iG59DYO18RH81SxT92giPM6iT7oXWNSu0co=", + "owner": "Sigmapitech", + "repo": "vera-clang", + "rev": "53a602b99e1c954802d7cec8ea932d4263aea862", + "type": "github" + }, + "original": { + "owner": "Sigmapitech", + "repo": "vera-clang", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/Cpp/{{ cookiecutter.project_name }}/flake.nix b/Cpp/{{ cookiecutter.project_name }}/flake.nix new file mode 100644 index 0000000..cd32307 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/flake.nix @@ -0,0 +1,110 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + cs-flake = { + url = "github:Sigmapitech/cs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + pre-commit-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + pre-commit-hooks, + nixpkgs, + cs-flake, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + cs = cs-flake.packages.${system}.report; + cs-wrapped = pkgs.writeShellScriptBin "cs" '' + ${cs}/bin/cs . --ignore-rules=C-G1 --use-gitignore + ''; + in { + formatter.${system} = pkgs.alejandra; + + checks.${system} = let + hooks = { + alejandra.enable = true; + + cs-check = { + enable = true; + name = "Coding style"; + entry = "${cs-wrapped}/bin/cs"; + files = "\\.*"; + }; + + commit-name = { + enable = true; + name = "commit name"; + stages = ["commit-msg"]; + entry = '' + ${pkgs.python310.interpreter} ${./check_commit_msg.py} + ''; + }; + }; + in { + pre-commit-check = pre-commit-hooks.lib.${system}.run { + inherit hooks; + src = ./.; + }; + }; + + devShells.${system}.default = pkgs.mkShell { + hardeningDisable = ["format" "fortify"]; + packages = with pkgs; [ + # debugging + valgrind + # tests + criterion + gcovr + # docs + doxygen + # compile_commands.json + bear + compiledb + # coding style + cs-wrapped + ]; + + inputsFrom = [self.packages.${system}.docs-pdf]; + + env.MANPATH = "./docs/man"; + shellHook = '' + ${self.checks.${system}.pre-commit-check.shellHook} + + export MAKEFLAGS="-j $NIX_BUILD_CORES" + alias cs="${cs-wrapped}/bin/cs" + ''; + }; + + packages.${system} = let + bins = ["release" "debug" "check"]; + in + { + docs-pdf = pkgs.callPackage ./nix/docs-pdf.nix {}; + default = pkgs.callPackage ./nix/bundle.nix { + derivs = + builtins.map (name: { + inherit name; + bin = pkgs.lib.getExe self.packages.${system}.${name}; + }) + bins; + }; + } + // (with builtins; + listToAttrs (map (name: { + inherit name; + value = pkgs.callPackage ./nix/package-builder.nix { + inherit name; + }; + }) + bins)); + }; +} diff --git a/Cpp/{{ cookiecutter.project_name }}/header.html b/Cpp/{{ cookiecutter.project_name }}/header.html new file mode 100644 index 0000000..4d63819 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/header.html @@ -0,0 +1,86 @@ + + + + + + + + +$projectname: $title +$title + + + + + + + + +$treeview +$search +$mathjax +$darkmode + +$extrastylesheet + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
$projectname $projectnumber +
+
$projectbrief
+
+
$projectbrief
+
$searchbox
$searchbox
+
+ + diff --git a/Cpp/{{ cookiecutter.project_name }}/hook.mk b/Cpp/{{ cookiecutter.project_name }}/hook.mk new file mode 100644 index 0000000..eec409d --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/hook.mk @@ -0,0 +1,8 @@ +## +## EPITECH PROJECT, 2025 +## template +## File description: +## hook +## + +_fclean += $(BUILD_DIR) diff --git a/Cpp/{{ cookiecutter.project_name }}/includes/.gitkeep b/Cpp/{{ cookiecutter.project_name }}/includes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Cpp/{{ cookiecutter.project_name }}/makeincludes/docs.mk b/Cpp/{{ cookiecutter.project_name }}/makeincludes/docs.mk new file mode 100644 index 0000000..21f81be --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/makeincludes/docs.mk @@ -0,0 +1,27 @@ +## +## EPITECH PROJECT, 2025 +## template +## File description: +## docs +## + +.PHONY: docs +docs: Doxyfile #? docs: create manpages and html docs + @ doxygen $^ + +.PHONY: pdf +pdf: docs #? pdf: create a pdf docs + $Q $(MAKE) -sC docs/latex >/dev/null + @ ln -sf docs/latex/refman.pdf docs.pdf + +.PHONY: docs-clean +docs-clean: #? docs-clean: remove the docs folder + $Q $(RM) -r docs + +.PHONY: docs-fclean +docs-fclean: docs-clean #? doc-fclean: remove the pdf doc-file + $Q $(RM) docs.pdf + +.PHONY: docs-re +.NOTPARALLEL: docs-re +docs-re: docs-fclean docs #? docs-re: redo manpages and html docs diff --git a/Cpp/{{ cookiecutter.project_name }}/makeincludes/log-helper.mk b/Cpp/{{ cookiecutter.project_name }}/makeincludes/log-helper.mk new file mode 100644 index 0000000..828e8a6 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/makeincludes/log-helper.mk @@ -0,0 +1,44 @@ +## +## EPITECH PROJECT, 2025 +## template +## File description: +## log-helper +## + +V ?= 0 +ifneq ($(V),0) + Q := +else + Q := @ +endif + +ifneq ($(shell command -v tput),) + ifneq ($(shell tput colors),0) + +mk-color = \e[$(strip $1)m + +C_BEGIN := \033[A +C_RESET := $(call mk-color, 00) + +C_RED := $(call mk-color, 31) +C_GREEN := $(call mk-color, 32) +C_YELLOW := $(call mk-color, 33) +C_BLUE := $(call mk-color, 34) +C_PURPLE := $(call mk-color, 35) +C_CYAN := $(call mk-color, 36) + + endif +endif + +NOW = $(shell date +%s%3N) +STIME := $(call NOW) +TIME_NS = $(shell expr $(call NOW) - $(STIME)) +TIME_MS = $(shell expr $(call TIME_NS)) + +BOXIFY = "[$(C_BLUE)$(1)$(C_RESET)] $(2)" + +ifneq ($(shell command -v printf),) + LOG_TIME = printf $(call BOXIFY, %6s , %b\n) "$(call TIME_MS)" +else + LOG_TIME = echo -e $(call BOXIFY, $(call TIME_MS) ,) +endif diff --git a/Cpp/{{ cookiecutter.project_name }}/makeincludes/mk-recipes.mk b/Cpp/{{ cookiecutter.project_name }}/makeincludes/mk-recipes.mk new file mode 100644 index 0000000..bd1dcd3 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/makeincludes/mk-recipes.mk @@ -0,0 +1,39 @@ +## +## EPITECH PROJECT, 2025 +## template +## File description: +## mk-recipes +## + +# $(eval $(call mk-recipe-binary, ...)) + +# $1 -> binary-name +# $2 -> src-list +# $3 -> extra-flags + +_clean := +_fclean := + +define mk-recipe-binary + +obj-$(strip $1) := $$($(strip $2):%.cpp=$$(BUILD_DIR)/$(strip $1)/%.o) +out-$(strip $1) := $(strip $1) + +$$(BUILD_DIR)/$(strip $1)/%.o: %.cpp + @ mkdir -p $$(dir $$@) + $$Q $$(CC) \ + $$(CFLAGS) $$(CFLAGS_@$$(notdir $$(@:.o=))) $3 \ + -o $$@ -c $$< + @ $$(LOG_TIME) "CC $$(C_PURPLE) $$(notdir $$@) $$(C_RESET)" + +$$(out-$(strip $1)): $$(obj-$(strip $1)) + @ mkdir -p $$(dir $$@) + $$Q $$(CC) -o $$@ $$(obj-$(strip $1)) \ + $$(CFLAGS) $$(CFLAGS_@$$(notdir $$(@:.o=))) $3 \ + $$(LDLIBS) $$(LDFLAGS) + @ $$(LOG_TIME) "LD $$(C_GREEN) $$@ $$(C_RESET)" + +_clean += $$(obj-$(strip $1)) +_fclean += $$(out-$(strip $1)) + +endef diff --git a/Cpp/{{ cookiecutter.project_name }}/nix/bundle.nix b/Cpp/{{ cookiecutter.project_name }}/nix/bundle.nix new file mode 100644 index 0000000..01d6c0b --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/nix/bundle.nix @@ -0,0 +1,26 @@ +{ + stdenvNoCC, + lib, + derivs, +}: let + installCommands = lib.concatStringsSep "\n" (map (deriv: '' + ln -sf ${deriv.bin} ${placeholder "out"}/bin/${deriv.name} + '') + derivs); +in + stdenvNoCC.mkDerivation { + name = "bundle"; + + dontUnpack = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + + ${installCommands} + + runHook postInstall + ''; + } diff --git a/Cpp/{{ cookiecutter.project_name }}/nix/docs-pdf.nix b/Cpp/{{ cookiecutter.project_name }}/nix/docs-pdf.nix new file mode 100644 index 0000000..7a403f1 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/nix/docs-pdf.nix @@ -0,0 +1,71 @@ +{ + stdenv, + texlive, + lib, + ncurses, + doxygen, + fetchFromGitHub, +}: let + doxygen-awesome-css = fetchFromGitHub { + owner = "jothepro"; + repo = "doxygen-awesome-css"; + rev = "28ed396de19cd3d803bcb483dceefdb6d03b1b2b"; + hash = "sha256-EtCv9bJJKWWL7/5KDnmQJV3JSk18qpcxEkQAyCpx+Lo="; + }; + + doxygen-tex = texlive.combine { + inherit + (texlive) + scheme-basic + adjustbox + alphalph + caption + changepage + collection-fontsrecommended + ec + enumitem + etoc + etoolbox + fancyvrb + float + hanging + metafont + multirow + newunicodechar + stackengine + tocloft + ulem + varwidth + wasysym + xcolor + ; + }; +in + stdenv.mkDerivation { + name = "docs-pdf"; + src = ./..; + + preConfigure = '' + cp -r ${doxygen-awesome-css} doxygen-awesome-css + chmod -R +w doxygen-awesome-css + ''; + + enableParallelBuilding = true; + makeFlags = ["pdf"]; + + installPhase = '' + runHook preInstall + + install -Dm 640 docs.pdf -t $out + + runHook postInstall + ''; + + nativeBuildInputs = [doxygen-tex doxygen ncurses]; + + meta = { + description = "Doxygen pdf documentation"; + maintainers = [lib.maintainers.sigmanificient]; + platforms = lib.platforms.all; + }; + } diff --git a/Cpp/{{ cookiecutter.project_name }}/nix/package-builder.nix b/Cpp/{{ cookiecutter.project_name }}/nix/package-builder.nix new file mode 100644 index 0000000..6494396 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/nix/package-builder.nix @@ -0,0 +1,25 @@ +{ + stdenv, + lib, + name, +}: +stdenv.mkDerivation (finalAttrs: { + inherit name; + src = ./..; + + enableParralelBuilding = true; + makeTargets = ["${finalAttrs.name}"]; + + installPhase = '' + runHook postInstall + + install -Dm755 ${finalAttrs.name} -t $out/bin + + runHook postInstall + ''; + + meta = { + mainProgram = name; + maintainers = with lib.maintainers; [sigmanificient]; + }; +}) diff --git a/Cpp/{{ cookiecutter.project_name }}/sourcelist.mk b/Cpp/{{ cookiecutter.project_name }}/sourcelist.mk new file mode 100644 index 0000000..651c714 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/sourcelist.mk @@ -0,0 +1,14 @@ +## +## EPITECH PROJECT, 2025 +## template +## File description: +## sourcelist +## + +INCDIRS := . includes + +VPATH := src +SRC-OUT := main.cpp + +VPATH += tests +TST-OUT := test_suite.cpp diff --git a/Cpp/{{ cookiecutter.project_name }}/src/main.cpp b/Cpp/{{ cookiecutter.project_name }}/src/main.cpp new file mode 100644 index 0000000..78c698f --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + return EXIT_SUCCESS; +} diff --git a/Cpp/{{ cookiecutter.project_name }}/tests/test_suite.cpp b/Cpp/{{ cookiecutter.project_name }}/tests/test_suite.cpp new file mode 100644 index 0000000..13320a6 --- /dev/null +++ b/Cpp/{{ cookiecutter.project_name }}/tests/test_suite.cpp @@ -0,0 +1,6 @@ +#include + +Test(test_suite, test_case) +{ + cr_assert(1 == 1); +} diff --git a/Haskell/cookiecutter.json b/Haskell/cookiecutter.json new file mode 100644 index 0000000..3544a8f --- /dev/null +++ b/Haskell/cookiecutter.json @@ -0,0 +1,11 @@ +{ + "binary_name": "tmp", + "project_name": "tmp", + "group_name": "Tmp", + "mail": "gabriel.hosquet@epitech.eu", + "github_owner": "Ciztek", + "_copy_without_render": [ + "dockerfile", + "check_commit_msg.py" + ] +} diff --git a/Haskell/hooks/post_gen_project.sh b/Haskell/hooks/post_gen_project.sh new file mode 100644 index 0000000..dac8e80 --- /dev/null +++ b/Haskell/hooks/post_gen_project.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +chmod +w * +chmod +w .* + +mv * .. +mv .* .. +rm -rfv ../{{ cookiecutter.project_name }} + diff --git a/Haskell/{{ cookiecutter.project_name }}/.gitignore b/Haskell/{{ cookiecutter.project_name }}/.gitignore new file mode 100644 index 0000000..1e14c2d --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/.gitignore @@ -0,0 +1,21 @@ +# binaries +debug +check +{{ cookiecutter.project_name }} + +# nix +result* +.direnv + +# generated precommit +.pre-commit-config.yaml + +# docs +docs/ +docs.pdf + +# build +.stack-work/ +.build +*.[aod] +hook.mk diff --git a/Haskell/{{ cookiecutter.project_name }}/CHANGELOG.md b/Haskell/{{ cookiecutter.project_name }}/CHANGELOG.md new file mode 100644 index 0000000..0be106b --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog for `{{ cookiecutter.project_name }}` + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to the +[Haskell Package Versioning Policy](https://pvp.haskell.org/). + +## Unreleased + +## 0.1.0.0 - {% now 'utc', '%D' %} diff --git a/Haskell/{{ cookiecutter.project_name }}/LICENSE b/Haskell/{{ cookiecutter.project_name }}/LICENSE new file mode 100644 index 0000000..379e24c --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/LICENSE @@ -0,0 +1,26 @@ +Copyright {% now 'utc', '%Y' %} {{ cookiecutter.group_name }} here + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Haskell/{{ cookiecutter.project_name }}/Makefile b/Haskell/{{ cookiecutter.project_name }}/Makefile new file mode 100644 index 0000000..741bef8 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/Makefile @@ -0,0 +1,30 @@ +NAME := {{ cookiecutter.binary_name }} + +FLAGS := --allow-different-user + +STACK_PATH := $(shell stack path --local-install-root $(FLAGS)) +BIN_PATH := $(STACK_PATH)/bin/{{ cookiecutter.project_name }}-exe + +all: $(NAME) + +.PHONY: all $(NAME) + +$(NAME): + stack build $(FLAGS) && ln -sf $(BIN_PATH) $(NAME) + +tests_run: + stack build $(FLAGS) && \ + stack test $(FLAGS) + +clean: + rm -f $(NAME) + stack clean $(FLAGS) + +fclean: clean + stack purge $(FLAGS) + +.PHONY: clean fclean + +re: fclean all + +.PHONY: re diff --git a/Haskell/{{ cookiecutter.project_name }}/README.md b/Haskell/{{ cookiecutter.project_name }}/README.md new file mode 100644 index 0000000..d3bd4a1 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/README.md @@ -0,0 +1 @@ +# {{ cookiecutter.project_name }} diff --git a/Haskell/{{ cookiecutter.project_name }}/Setup.hs b/Haskell/{{ cookiecutter.project_name }}/Setup.hs new file mode 100644 index 0000000..005cd39 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/Setup.hs @@ -0,0 +1,9 @@ +{- +-- EPITECH PROJECT, {% now 'utc', '%Y' %} +-- {{ cookiecutter.project_name }} +-- File description: +-- Setup +-} + +import Distribution.Simple +main = defaultMain diff --git a/Haskell/{{ cookiecutter.project_name }}/app/Main.hs b/Haskell/{{ cookiecutter.project_name }}/app/Main.hs new file mode 100644 index 0000000..1f39eca --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/app/Main.hs @@ -0,0 +1,13 @@ +{- +-- EPITECH PROJECT, {% now 'utc', '%Y' %} +-- {{ cookiecutter.project_name }} +-- File description: +-- Main +-} + +module Main (main) where + +import Lib + +main :: IO () +main = someFunc diff --git a/Haskell/{{ cookiecutter.project_name }}/check_commit_msg.py b/Haskell/{{ cookiecutter.project_name }}/check_commit_msg.py new file mode 100644 index 0000000..99a0762 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/check_commit_msg.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +import pathlib +import os +import sys + + +def has_correct_message(msg: str) -> bool: + print(f"Commit message:\n{msg}") + + verb, *words = msg.split() + report = { + " " in msg: "double space!", + msg.startswith(" ") or msg.endswith(" "): "leading or trailling space", + verb[0].islower(): "verb is not capitalized", + any(map(verb.endswith, {"ed", "ing", "s"})): "use imperative tense", + msg.endswith("."): "message should not end with a period", + len(words) < 2: "include at least 3 words", + }.get(True) + + if report is None: + return True + + print(report) + return False + + +def main(): + if len(sys.argv) != 2: + return os.EX_USAGE + + message = pathlib.Path(sys.argv[1]).read_text() + return not has_correct_message(message) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/Haskell/{{ cookiecutter.project_name }}/dockerfile b/Haskell/{{ cookiecutter.project_name }}/dockerfile new file mode 100644 index 0000000..f10fa3f --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/dockerfile @@ -0,0 +1,26 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/release"] diff --git a/Haskell/{{ cookiecutter.project_name }}/package.yaml b/Haskell/{{ cookiecutter.project_name }}/package.yaml new file mode 100644 index 0000000..b909ec0 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/package.yaml @@ -0,0 +1,59 @@ +name: {{ cookiecutter.project_name }} +version: 0.1.0.0 +github: "{{ cookiecutter.github_owner }}/{{ cookiecutter.project_name }}" +license: BSD-3-Clause +author: "{{ cookiecutter.group_name }}" +maintainer: "{{ cookiecutter.mail }}" +copyright: "{% now 'utc', '%Y' %} {{ cookiecutter.group_name }}" + +extra-source-files: +- README.md +- CHANGELOG.md + +# Metadata used when publishing your package +# synopsis: Short description of your package +# category: Web + +# To avoid duplicated efforts in documentation and dealing with the +# complications of embedding Haddock markup inside cabal files, it is +# common to point users to the README.md file. +description: Please see the README on GitHub at + +dependencies: +- base >= 4.7 && < 5 + +ghc-options: +- -Wall +- -Wcompat +- -Widentities +- -Wincomplete-record-updates +- -Wincomplete-uni-patterns +- -Wmissing-export-lists +- -Wmissing-home-modules +- -Wpartial-fields +- -Wredundant-constraints + +library: + source-dirs: src + +executables: + {{ cookiecutter.project_name }}-exe: + main: Main.hs + source-dirs: app + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - {{ cookiecutter.project_name }} + +tests: + {{ cookiecutter.project_name }}-test: + main: Spec.hs + source-dirs: test + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - {{ cookiecutter.project_name }} diff --git a/Haskell/{{ cookiecutter.project_name }}/src/Lib.hs b/Haskell/{{ cookiecutter.project_name }}/src/Lib.hs new file mode 100644 index 0000000..35fee7e --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/src/Lib.hs @@ -0,0 +1,13 @@ +{- +-- EPITECH PROJECT, {% now 'utc', '%Y' %} +-- {{ cookiecutter.project_name }} +-- File description: +-- Lib +-} + +module Lib + ( someFunc + ) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/Haskell/{{ cookiecutter.project_name }}/stack.yaml b/Haskell/{{ cookiecutter.project_name }}/stack.yaml new file mode 100644 index 0000000..06e4b2f --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/stack.yaml @@ -0,0 +1,67 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/yaml_configuration/ + +# A 'specific' Stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +snapshot: lts-20.11 +# snapshot: nightly-2024-07-05 +# snapshot: ghc-9.6.6 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# snapshot: ./custom-snapshot.yaml +# snapshot: https://example.com/snapshots/2024-01-01.yaml +#snapshot: +# url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/3.yaml + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# subdirs: +# - auto-update +# - wai +packages: +- . +# Dependency packages to be pulled from upstream that are not in the snapshot. +# These entries can reference officially published versions as well as +# forks / in-progress versions pinned to a git hash. For example: +# +# extra-deps: +# - acme-missiles-0.3 +# - git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# +# extra-deps: [] + +# Override default flag values for project packages and extra-deps +# flags: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of Stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=3.1" +# +# Override the architecture used by Stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by Stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor diff --git a/Haskell/{{ cookiecutter.project_name }}/test/Spec.hs b/Haskell/{{ cookiecutter.project_name }}/test/Spec.hs new file mode 100644 index 0000000..6af0c3b --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/test/Spec.hs @@ -0,0 +1,9 @@ +{- +-- EPITECH PROJECT, {% now 'utc', '%Y' %} +-- {{ cookiecutter.project_name }} +-- File description: +-- Spec +-} + +main :: IO () +main = putStrLn "Test suite not yet implemented" diff --git a/Haskell/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}.cabal b/Haskell/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}.cabal new file mode 100644 index 0000000..98de870 --- /dev/null +++ b/Haskell/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}.cabal @@ -0,0 +1,67 @@ +cabal-version: 2.2 + +-- This file has been generated from package.yaml by hpack version 0.37.0. +-- +-- see: https://github.com/sol/hpack + +name: {{ cookiecutter.project_name }} +version: 0.1.0.0 +description: Please see the README on GitHub at +homepage: https://github.com/{{ cookiecutter.github_owner }}/{{ cookiecutter.project_name }}#readme +bug-reports: https://github.com/{{ cookiecutter.github_owner }}/{{ cookiecutter.project_name }}/issues +author: {{ cookiecutter.group_name }} +maintainer: {{ cookiecutter.mail }} +copyright: {% now 'utc', '%Y' %} {{ cookiecutter.group_name }} +license: BSD-3-Clause +license-file: LICENSE +build-type: Simple +extra-source-files: + README.md + CHANGELOG.md + +source-repository head + type: git + location: https://github.com/{{ cookiecutter.github_owner }}/{{ cookiecutter.group_name }} + +library + exposed-modules: + Lib + other-modules: + Paths_{{ cookiecutter.project_name }} + autogen-modules: + Paths_{{ cookiecutter.project_name }} + hs-source-dirs: + src + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints + build-depends: + base >=4.7 && <5 + default-language: Haskell2010 + +executable {{ cookiecutter.project_name }}-exe + main-is: Main.hs + other-modules: + Paths_{{ cookiecutter.project_name }} + autogen-modules: + Paths_{{ cookiecutter.project_name }} + hs-source-dirs: + app + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + {{ cookiecutter.project_name }} + , base >=4.7 && <5 + default-language: Haskell2010 + +test-suite {{ cookiecutter.project_name }}-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Paths_{{ cookiecutter.project_name }} + autogen-modules: + Paths_{{ cookiecutter.project_name }} + hs-source-dirs: + test + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + {{ cookiecutter.project_name }} + , base >=4.7 && <5 + default-language: Haskell2010 diff --git a/cookiecutter.json b/cookiecutter.json index 0143ecc..b34422b 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -4,6 +4,16 @@ "path": "C", "title": "C Template", "description": "The C template" + }, + "project-2": { + "path": "Haskell", + "title": "Haskell Template", + "description": "The Haskell template" + }, + "project-3": { + "path":"Cpp", + "title": "Cpp template", + "description": "The template for c++" } } } diff --git a/flake.nix b/flake.nix index f9f8d57..a1b5b89 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ pkgs = nixpkgs.legacyPackages.${system}; create-template = with pkgs; writeShellScriptBin "run" '' - ${lib.getExe cookiecutter} https://github.com/Ciztek/Template \ + ${lib.getExe cookiecutter} ${./.} \ --checkout main \ --output-dir . '';