Skip to content

Commit d58e982

Browse files
authored
Merge pull request #13 from jcook3701/develop
Feat 004 (#12)
2 parents 0927595 + 324b1a2 commit d58e982

60 files changed

Lines changed: 3535 additions & 713 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{#
2+
# gitignore.j2 for cookiecutter-cookiecutter
3+
#
4+
# Copyright (c) 2025, Jared Cook
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <www.gnu.org>.
19+
#}
20+
21+
{% macro gitignore(
22+
template_type
23+
) -%}
24+
25+
{%- set ansible -%}
26+
# =========================================
27+
# Ansible Galaxy Ignores #
28+
# =========================================
29+
ansible.cfg
30+
hosts
31+
inventory.yml
32+
**/vault.yml
33+
/group_vars
34+
/host_vars
35+
{%- endset -%}
36+
37+
{%- set python -%}
38+
# =========================================
39+
# Python project ignores #
40+
# =========================================
41+
__pycache__/
42+
*.egg-info/
43+
.mypy_cache/
44+
.pytest_cache/
45+
.ruff_cache/
46+
.venv/
47+
dist/
48+
{%- endset -%}
49+
50+
{%- set ansible_cookiecutter = ansible ~ '\n' ~ python -%}
51+
52+
{% if template_type == "ansible" %}
53+
{{ ansible_cookiecutter }}
54+
{% elif template_type in ["c", "c++", "c/cc", "c/c++"] %}
55+
# =========================================
56+
# C/C++ Ignores #
57+
# =========================================
58+
*.o
59+
*.a
60+
*.out
61+
{% elif template_type in ["cookiecutter", "python"] %}
62+
{{ python }}
63+
{% elif template_type == "ros2" %}
64+
# =========================================
65+
# ROS2 Ignores #
66+
# =========================================
67+
install/
68+
build/
69+
log/
70+
{% elif template_type == "typescript" %}
71+
# =========================================
72+
# Typescript Ignores #
73+
# =========================================
74+
node_modules/
75+
dist/
76+
*.tsbuildinfo
77+
{% endif %}
78+
{%- endmacro -%}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{#
2+
# license_header.j2 for cookiecutter-cookiecutter
3+
#
4+
# Copyright (c) 2025, Jared Cook
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <www.gnu.org>.
19+
#}
20+
21+
{%- macro license_header(
22+
license_type,
23+
author,
24+
project_name,
25+
file_name='none',
26+
comment_style='hash'
27+
) -%}
28+
{#
29+
This renders license header depending on user selection of cookiecutter.license.
30+
Args: license_type, author, file_name, comment_style.
31+
#}
32+
{# This macro generates the correct license header based on input #}
33+
{# Define variables for start/end comment delimiters #}
34+
{%- set start_comment = "" -%}
35+
{%- set end_comment = "" -%}
36+
{%- set newline = "\n" -%}
37+
{# Determine the correct comment style #}
38+
{%- if comment_style == 'python' -%}
39+
{%- set start_comment = '"""' + newline -%}
40+
{%- set end_comment = newline + '"""' -%}
41+
{%- elif comment_style == 'html' -%}
42+
{%- set start_comment = '<!-- ' + newline -%}
43+
{%- set end_comment = newline + '-->' -%}
44+
{%- else -%}
45+
{# Default to hash/pound symbol for yaml, toml, shell scripts, etc. #}
46+
{%- set start_comment = '#' -%}
47+
{%- set end_comment = newline -%}
48+
{%- endif -%}
49+
{# Generate the core license text #}
50+
{% set license_text %}
51+
{{ file_name }} for {{ project_name }}
52+
53+
Copyright (c) {% now 'utc', '%Y' %}, {{ author }}
54+
{% if license_type == "Apache-2.0" -%}
55+
SPDX-License-Identifier: Apache-2.0
56+
57+
Licensed under the Apache License, Version 2.0 (the "License");
58+
you may not use this file except in compliance with the License.
59+
You may obtain a copy of the License at
60+
61+
www.apache.org
62+
63+
Unless required by applicable law or agreed to in writing, software
64+
distributed under the License is distributed on an "AS IS" BASIS,
65+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66+
See the License for the specific language governing permissions and
67+
limitations under the License.
68+
{% elif license_type == "BSD-3-Clause" -%}
69+
SPDX-License-Identifier: BSD-3-Clause
70+
71+
Redistribution and use in source and binary forms, with or without
72+
modification, are permitted provided that the following conditions are met:
73+
74+
1. Redistributions of source code must retain the above copyright notice, this
75+
list of conditions and the following disclaimer.
76+
77+
2. Redistributions in binary form must reproduce the above copyright notice,
78+
this list of conditions and the following disclaimer in the documentation
79+
and/or other materials provided with the distribution.
80+
81+
3. Neither the name of the copyright holder nor the names of its
82+
contributors may be used to endorse or promote products derived from
83+
this software without specific prior written permission.
84+
85+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
86+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
87+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
88+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
89+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
90+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
91+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
92+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
93+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
94+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95+
{% elif license_type == "GPL-3.0" -%}
96+
SPDX-License-Identifier: GPL-3.0-or-later
97+
98+
This program is free software: you can redistribute it and/or modify
99+
it under the terms of the GNU General Public License as published by
100+
the Free Software Foundation, either version 3 of the License, or
101+
(at your option) any later version.
102+
103+
This program is distributed in the hope that it will be useful,
104+
but WITHOUT ANY WARRANTY; without even the implied warranty of
105+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106+
GNU General Public License for more details.
107+
108+
You should have received a copy of the GNU General Public License
109+
along with this program. If not, see <www.gnu.org>.
110+
{% elif license_type == "MIT" -%}
111+
SPDX-License-Identifier: MIT
112+
113+
Permission is hereby granted, free of charge, to any person obtaining a copy
114+
of this software and associated documentation files (the "Software"), to deal
115+
in the Software without restriction, including without limitation the rights
116+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117+
copies of the Software, and to permit persons to whom the Software is
118+
furnished to do so, subject to the following conditions:
119+
120+
The above copyright notice and this permission notice shall be included in all
121+
copies or substantial portions of the Software.
122+
123+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
129+
SOFTWARE.
130+
{% endif -%}
131+
{%- endset -%}
132+
{# Wrap the generated text with the appropriate start and end delimiters #}
133+
{%- if comment_style == 'python' or comment_style == 'html' -%}
134+
{{ start_comment -}}
135+
{{ license_text | trim }}
136+
{{- end_comment }}
137+
{%- else -%}
138+
{%- set text = license_text.split('\n') -%}
139+
{# For hash comments, prefix every line with '#' #}
140+
{%- for line in text -%}
141+
{%- if line == '' or line == '\n' -%}
142+
{%- set commented_line = line -%}
143+
{%- else -%}
144+
{%- set commented_line = " " + line -%}
145+
{%- endif -%}
146+
#{{ commented_line }}
147+
{% endfor -%}
148+
{%- endif -%}
149+
{%- endmacro -%}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{#
2+
# make/__init__.j2 for cookiecutter-cookiecutter
3+
#
4+
# Copyright (c) 2025, Jared Cook
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <www.gnu.org>.
19+
#}
20+
21+
{% import '.cookiecutter_includes/make/clean.j2' as _clean with context %}
22+
{% import '.cookiecutter_includes/make/docs.j2' as _docs with context %}
23+
{% import '.cookiecutter_includes/make/help.j2' as _help with context %}
24+
{% import '.cookiecutter_includes/make/phony.j2' as _phony with context %}
25+
{% import '.cookiecutter_includes/make/settings.j2' as _settings with context %}
26+
{% import '.cookiecutter_includes/make/version.j2' as _version with context %}
27+
28+
{% set clean = _clean %}
29+
{% set docs = _docs %}
30+
{% set help = _help %}
31+
{% set phony = _phony %}
32+
{% set settings = _settings %}
33+
{% set version = _version %}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{#
2+
# make/clean.j2 for cookiecutter-cookiecutter
3+
#
4+
# Copyright (c) 2025, Jared Cook
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <www.gnu.org>.
19+
#}
20+
21+
{% macro clean(
22+
jekyll_enabled,
23+
sphinx_enabled
24+
) -%}
25+
# --------------------------------------------------
26+
# 🧹 Clean artifacts
27+
# --------------------------------------------------
28+
clean-docs:
29+
$(AT)echo "🧹 Cleaning documentation artifacts..."
30+
{% if sphinx_enabled %}
31+
$(AT)$(MAKE) -C $(SPHINX_DIR) clean
32+
{% endif %}
33+
{% if jekyll_enabled %}
34+
$(AT)$(MAKE) -C $(JEKYLL_DIR) clean
35+
{% endif %}
36+
$(AT)echo "✅ Cleaned documentation artifacts..."
37+
38+
clean-build:
39+
$(AT)echo "🧹 Cleaning build artifacts..."
40+
$(AT)rm -rf build dist *.egg-info
41+
$(AT)find $(SRC_DIR) $(TESTS_DIR) -name "__pycache__" -type d -exec rm -rf {} +
42+
$(AT)-[ -d "$(VENV_DIR)" ] && rm -r $(VENV_DIR)
43+
$(AT)echo "🧹 Cleaned build artifacts."
44+
45+
clean: clean-docs clean-build
46+
{%- endmacro -%}

0 commit comments

Comments
 (0)