Conversation
8e55c75 to
d3b9668
Compare
fca125a to
4f4c113
Compare
This commit introduces a 'cookiecutter' directory that users can use to spin off new projects using exemplar as a template. After invoking cookiecutter on the repository, users are prompted for a new project name, directory name, C++ version, paper, owner, and description, and these values are filled into the template. It also adds two new checks into CI: that, when the template is filled in with the values for exemplar itself, the result is identical to exemplar; and, that if a name other than "exemplar" is specified for the project name, then the string "exemplar" does not appear in the output when the template is filled in. These CI checks can be tested by maintainers of exemplar without needing to update the pull request by running the script check_cookiecutter.sh.
4f4c113 to
318671a
Compare
|
You need to make all your changes twice-- e.g., once in |
and what is the real benefit of tis cookie cutter? |
|
People using exemplar as a template for new projects can invoke |
|
sorry, everywere beman and exemmplar found, this does not really help: klein_cl@lx005535:~/Workspace/cpp/beman/exemplar$ egrep -rw '(exemplar|EXEMPLAR)' cookiecutter/
cookiecutter/check_cookiecutter.sh: project_name="exemplar" \
cookiecutter/check_cookiecutter.sh: cp "$script_dir"/../.github/workflows/cookiecutter_test.yml "$out_dir_path"/exemplar/.github/workflows
cookiecutter/check_cookiecutter.sh: diff -r "$script_dir/.." "$out_dir_path/exemplar" \
cookiecutter/check_cookiecutter.sh: echo "Discrepancy between exemplar and cookiecutter:" >&2
cookiecutter/check_cookiecutter.sh: "exemplar" "$out_dir_path/RLZrmX9NfS" > "$grep_path" || true
cookiecutter/check_cookiecutter.sh: echo "Untemplated \"exemplar\" in cookiecutter:" >&2
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/conftest.py: "markers", "use_test_repo: mark test to use test repository instead of exemplar"
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/test_readme.py: # Title: # beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/test_readme.py: # Title: # beman.exemplar: Another Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/test_readme.py: # Title: # beman.exemplar: Awesome Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/test_readme.py: # Title: # beman.exemplar: The Most Awesome Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v1.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v1.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v1.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v2.md:# beman.exemplar: Another Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v2.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v2.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v4.md:# beman.exemplar: The Most Awesome Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v4.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v4.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v3.md:# beman.exemplar: Awesome Beman Library
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v3.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/valid/README-v3.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v4.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v4.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v2.md:# beman.exemplar A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v2.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v2.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v1.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v1.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v1.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v1.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v1.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v1.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v3.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v3.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v3.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v3.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v3.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v2.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v2.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v2.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v1.md:# beman exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v1.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v1.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-title-v1.md:This is NOT a valid README.md according to the Beman Standard: missing beman.exemplar.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v3.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v3.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-status-line-v3.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v2.md:# beman.exemplar: A Beman Library Exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v2.md:  
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/lib/checks/beman_standard/readme/data/invalid/invalid-badge-v2.md:**Purpose**: `beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/utils/conftest.py: """Return repository information for beman.exemplar library"""
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/utils/conftest.py: "name": "exemplar",
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/tests/utils/conftest.py: "remote_url": "https://github.com/bemanproject/exemplar",
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:- Run beman-tidy on the exemplar repository **(default: dry-run mode)**
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:$ uv run beman-tidy /path/to/exemplar --require-all
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:$ uv run beman-tidy /path/to/exemplar
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:$ uv run beman-tidy /path/to/exemplar --require-all --verbose
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:[WARNING ][DIRECTORY.SOURCES ]: The directory '/Users/dariusn/dev/dn/git/Beman/exemplar/src/beman/exemplar' does not exist.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:$ uv run beman-tidy /path/to/exemplar --require-all --verbose
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:- Run beman-tidy on the exemplar repository (fix issues in-place):
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/README.md:uv run beman-tidy path/to/exemplar --fix-inplace --verbose
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/docs/dev-guide.md: * `repo_info`: The repository information (e.g., path, name, etc.). Mocked with hardcoded values of `beman.exemplar`.
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/beman_tidy/lib/utils/string.py: e.g.,   
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/beman_tidy/lib/checks/base/directory_base_check.py: # set path - e.g. "src/beman/exemplar"
cookiecutter/{{cookiecutter.project_name}}/infra/tools/beman-tidy/beman_tidy/lib/checks/beman_standard/release.py:# Note: Data is stored online - e.g. https://github.com/bemanproject/exemplar/releases
klein_cl@lx005535:~/Workspace/cpp/beman/exemplar$ |
|
All of those examples are either in the CI script that checks the cookiecutter template, or in the |
|
But than this template is only usable for |
|
Cookiecutter will also prompt you for the |
|
sorry to say, but that is the last contibution to this project, to mutch useless work! |
This commit introduces a 'cookiecutter' directory that users can use to spin off new projects using exemplar as a template. After invoking cookiecutter on the repository, users are prompted for a new project name, directory name, C++ version, paper, owner, and description, and these values are filled into the template.
It also adds two new checks into CI: that, when the template is filled in with the values for exemplar itself, the result is identical to exemplar; and, that if a name other than "exemplar" is specified for the project name, then the string "exemplar" does not appear in the output when the template is filled in.
These CI checks can be tested by maintainers of exemplar without
needing to update the pull request by running the script
check_cookiecutter.sh.