-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Migrate to Copier #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
pawamoy
wants to merge
23
commits into
main
Choose a base branch
from
copier
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
cbedeb8
feat: Copy contents from Python template, adapting it to shell a bit
pawamoy 4d5ca26
feat: Merge Cookiecutter contents into Copier subproject
pawamoy b605a16
Update copier.yml
pawamoy eea94bb
Update extensions.py
pawamoy 45191c0
Update tests/test_filenames.sh
pawamoy b0e65fc
Update project/tests/data.bash.jinja
pawamoy 5147d50
Update project/scripts/gen_ref_nav.py
pawamoy 77092d4
Update Makefile
pawamoy 2f74d07
Update Makefile
pawamoy cbcfcf7
Update project/scripts/gen_credits.py.jinja
pawamoy 296fc5c
Update README.md
pawamoy 999657d
Update docs/requirements.md
pawamoy 5b413d9
Update docs/requirements.md
pawamoy 476e181
Update docs/work.md
pawamoy b7c6875
Update tests/test_generate.sh
pawamoy 029fa87
Update docs/work.md
pawamoy ea5ba2d
Apply suggestions
pawamoy f7c321c
Merge branch 'copier' of github.com:shellm-org/template into copier
pawamoy 0fdf68f
Update project/.github/ISSUE_TEMPLATE/bug_report.md.jinja
pawamoy 08e999f
Update project/.github/workflows/release.yml.jinja
pawamoy f8b78bf
Update project/CONTRIBUTING.md.jinja
pawamoy 6aea92d
Remove funding file
pawamoy aed37bc
Remove licenses folder since we already have a single templated licen…
pawamoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# Change Log | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- insertion marker --> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, gender identity and expression, level of experience, | ||
nationality, personal appearance, race, religion, or sexual identity and | ||
orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,45 @@ | ||
# Contributing | ||
Contributions are welcome, and they are greatly appreciated! | ||
|
||
Contributions are welcome, and they are greatly appreciated! | ||
Every little bit helps, and credit will always be given. | ||
|
||
## Types of Contributions | ||
## Environment setup | ||
|
||
You need to install [Copier](https://github.com/copier-org/copier). | ||
|
||
```bash | ||
python3 -m pip install --user pipx | ||
pipx install copier | ||
pipx inject copier copier-templates-extensions | ||
``` | ||
|
||
## Running tests | ||
|
||
To run the tests, use: | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
### Bug Reports, Feature Requests, and Feedback | ||
Create a [new project issue][1]! Try to be as descriptive as possible. | ||
## Serving docs | ||
|
||
### Bug Fixes, New Features and Documentation | ||
Create a [new merge/pull request][2]! Make sure to follow the guidelines. | ||
You can create a new virtualenv | ||
and install `mkdocs` and `mkdocs-material`: | ||
|
||
## Merge/Pull Request Guidelines | ||
Make sure to have atomic commits and contextual commit messages! | ||
```bash | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install mkdocs mkdocs-material | ||
mkdocs serve | ||
``` | ||
|
||
[Check out this awesome blog post by Chris Beams for more information.][3] | ||
You can also install `mkdocs` with `pipx` and | ||
inject `mkdocs-material` in its venv, | ||
this way you don't need to create one yourself: | ||
|
||
[1]: https://github.com/shellm-org/cookiecutter-shellm/issues/new | ||
[2]: https://github.com/shellm-org/cookiecutter-shellm/compare | ||
[3]: http://chris.beams.io/posts/git-commit/ | ||
```bash | ||
python3 -m pip install --user pipx | ||
pipx install mkdocs | ||
pipx inject mkdocs mkdocs-material | ||
mkdocs serve | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.PHONY: $(MAKECMDGOALS) | ||
|
||
clean: | ||
@rm -rf tests/tmp | ||
|
||
cleantests: | ||
@rm -rf tests/tmp/.git | ||
<<<<<<< Updated upstream | ||
@rm -rf tests/tmp/empty | ||
@rm -f tests/tmp/CHANGELOG.md | ||
======= | ||
@rm -rf tests/tmp/CHANGELOG.md | ||
pawamoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
>>>>>>> Stashed changes | ||
|
||
docs: | ||
@mkdocs serve | ||
|
||
docs-deploy: | ||
@mkdocs gh-deploy | ||
|
||
format: | ||
@ruff format | ||
|
||
gen generate: | ||
@bash -c 'source tests/helpers.sh && generate ${PWD} tests/tmp' | ||
|
||
reset-history: gen | ||
@./reset-history.sh | ||
|
||
test: cleantests | ||
@./runtests.sh | ||
|
||
changelog: | ||
@git-changelog -Tio CHANGELOG.md -Bauto -c angular | ||
|
||
release: | ||
@test -n "$(version)" || { echo "error: usage: make release version=x.y.z" >&2; exit 1; } | ||
@git add CHANGELOG.md | ||
@git commit -m "docs: Update changelog for version $(version)" | ||
@git tag "$(version)" | ||
@git push | ||
@git push --tags | ||
bswck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
DUTIES = \ | ||
test-changelog \ | ||
test-check \ | ||
test-check-api \ | ||
test-check-docs \ | ||
test-check-quality \ | ||
test-clean \ | ||
test-coverage \ | ||
test-docs \ | ||
test-docs-deploy \ | ||
test-format \ | ||
test-help \ | ||
test-release \ | ||
test-setup \ | ||
test-test | ||
|
||
$(DUTIES): | ||
@cd tests/tmp && make $(subst test-,,$@) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,40 @@ | ||
# cookiecutter-shellm | ||
Cookiecutter to create a shellm app. | ||
# shellm template | ||
|
||
- Changelog: https://github.com/shellm-org/cookiecutter-shellm/CHANGELOG.md | ||
- Contributing: https://github.com/shellm-org/cookiecutter-shellm/CONTRIBUTING.md | ||
- Documentation: https://github.com/shellm-org/cookiecutter-shellm/wiki | ||
- License: ISC - https://github.com/shellm-org/cookiecutter-shellm/LICENSE | ||
[](https://github.com/shellm-org/template/actions?query=workflow%3Aci) | ||
[](https://shellm-org.github.io/template/) | ||
[](https://app.gitter.im/#/room/#shellm-org/community:gitter.im) | ||
|
||
- [Requirements](#requirements) | ||
- [Usage](#usage) | ||
- [Example](#example) | ||
[Copier](https://github.com/copier-org/copier) template | ||
for [shellm](https://github.com/shellm-org) projects. | ||
|
||
## Requirements | ||
- [git](https://git-scm.com/downloads) | ||
- [python](https://www.python.org/downloads/) | ||
- [cookiecutter](https://github.com/audreyr/cookiecutter) | ||
## Features | ||
|
||
- [Basher](https://github.com/basherpm/basher#readme) setup (installation, dependencies) | ||
- Pre-configured tools for quality analysis and testing: | ||
[shellcheck](https://github.com/koalaman/shellcheck#readme), | ||
[bats](https://github.com/bats-core/bats-core#readme) | ||
- Documentation built with [MkDocs](https://github.com/mkdocs/mkdocs#readme) | ||
([Material theme](https://github.com/squidfunk/mkdocs-material#readme) | ||
and "autodoc" [mkdocstrings plugin](https://github.com/mkdocstrings/mkdocstrings#readme)) | ||
- Support for GitHub workflows | ||
- Auto-generated `CHANGELOG.md` from Git (conventional) commits | ||
- All licenses from [choosealicense.com](https://choosealicense.com/appendix/) | ||
|
||
## Quick setup and usage | ||
|
||
Make sure all the | ||
[requirements](https://shellm-org.github.io/template/requirements) | ||
are met, then: | ||
|
||
```bash | ||
copier copy --trust "https://github.com/shellm-org/template.git" /path/to/your/new/project | ||
``` | ||
|
||
Or even shorter: | ||
|
||
## Usage | ||
```bash | ||
cookiecutter gl:shellm/cookiecutter-shellm | ||
# OR | ||
cookiecutter https://gitlab.com/shellm/cookiecutter-shellm | ||
copier copy --trust "gh:shellm-org/template" /path/to/your/new/project | ||
``` | ||
|
||
## Example | ||
See the [shellm-example app on GitLab](https://gitlab.com/shellm/example-shellm) | ||
(or [GitHub](https://github.com/shellm-org/example-shellm)) | ||
generated by this very cookiecutter. | ||
See the [documentation](https://shellm-org.github.io/template) | ||
for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# CONFIGURATION ------------------------- | ||
_min_copier_version: "9" | ||
_envops: | ||
autoescape: false | ||
keep_trailing_newline: true | ||
_subdirectory: project | ||
_templates_suffix: .jinja | ||
_jinja_extensions: | ||
- copier_templates_extensions.TemplateExtensionLoader | ||
- extensions.py:GitExtension | ||
- extensions.py:SlugifyExtension | ||
_skip_if_exists: | ||
- CHANGELOG.md | ||
|
||
# PROMPT -------------------------------- | ||
project_name: | ||
type: str | ||
help: Your project name | ||
|
||
project_description: | ||
type: str | ||
help: Your project description | ||
|
||
author_fullname: | ||
type: str | ||
help: Your full name | ||
default: "{{ 'Timothée Mazzucotelli' | git_user_name }}" | ||
|
||
author_email: | ||
type: str | ||
help: Your email | ||
default: "{{ '[email protected]' | git_user_email }}" | ||
|
||
author_username: | ||
type: str | ||
help: Your username (e.g. on GitHub) | ||
default: pawamoy | ||
|
||
repository_provider: | ||
type: str | ||
help: Your repository provider | ||
default: github.com | ||
choices: | ||
- github.com | ||
|
||
repository_namespace: | ||
type: str | ||
help: Your repository namespace | ||
default: "{{ author_username }}" | ||
|
||
repository_name: | ||
type: str | ||
help: Your repository name | ||
default: "{{ project_name | slugify }}" | ||
|
||
copyright_holder: | ||
type: str | ||
help: The name of the person/entity holding the copyright | ||
default: "{{ author_fullname }}" | ||
|
||
copyright_holder_email: | ||
type: str | ||
help: The email of the person/entity holding the copyright | ||
default: "{{ author_email }}" | ||
|
||
copyright_date: | ||
type: str | ||
help: The copyright date | ||
default: "{{ '%Y' | strftime }}" | ||
|
||
copyright_license: | ||
type: str | ||
help: Your project's license | ||
default: ISC License | ||
choices: | ||
- Academic Free License v3.0 | ||
- Apache License 2.0 | ||
- Artistic License 2.0 | ||
- BSD 2-Clause "Simplified" License | ||
- BSD 3-Clause Clear License | ||
- BSD 3-Clause "New" or "Revised" License | ||
- Boost Software License 1.0 | ||
- Creative Commons Attribution 4.0 | ||
- Creative Commons Attribution Share Alike 4.0 | ||
- Creative Commons Zero v1.0 Universal | ||
- Do What The F*ck You Want To Public License | ||
- Educational Community License v2.0 | ||
- Eclipse Public License 1.0 | ||
- Eclipse Public License 2.0 | ||
- European Union Public License 1.1 | ||
- European Union Public License 1.2 | ||
- GNU Affero General Public License v3.0 | ||
- GNU General Public License v2.0 | ||
- GNU General Public License v3.0 | ||
- GNU Lesser General Public License v2.1 | ||
- GNU Lesser General Public License v3.0 | ||
- ISC License | ||
- LaTeX Project Public License v1.3c | ||
- MIT License | ||
- Mozilla Public License 2.0 | ||
- Microsoft Public License | ||
- Microsoft Reciprocal License | ||
- University of Illinois/NCSA Open Source License | ||
- SIL Open Font License 1.1 | ||
- Open Software License 3.0 | ||
- PostgreSQL License | ||
- The Unlicense | ||
- zlib License | ||
|
||
shellm_package_source_name: | ||
type: str | ||
help: Your shellm package source name (for `shellm source NAME` in scripts/libraries) | ||
default: "{{ project_name | slugify('_') }}" | ||
|
||
shellm_package_script_name: | ||
type: str | ||
help: Your CLI name if any (for use in the shell) | ||
default: "{{ project_name | slugify }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--8<-- "CHANGELOG.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--8<-- "CODE_OF_CONDUCT.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--8<-- "CONTRIBUTING.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* More space at the bottom of the page */ | ||
.md-main__inner { | ||
margin-bottom: 1.5rem; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.