Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"Unlicense"
],
"ide_integration": true,
"issue_categorization": ["labels", "issue types"],
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
Expand Down Expand Up @@ -45,6 +46,7 @@
"author_email": "The e-mail address your package’s users can contact you under",
"github_user": "The GitHub username or org the project is to be published under",
"github_repo": "If the repo name should differ from the project name, edit it now",
"ide_integration": "Whether to generate IDE configuration files"
"ide_integration": "Whether to generate IDE configuration files",
"issue_categorization": "How to categorize issues in the issue templates. “issue types” only works in GitHub organizations, while “labels” also works in personal repos."
}
}
19 changes: 19 additions & 0 deletions scripts/tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@
pytest.param({"github_repo": "floob"}, "docs/conf.py", r'"github_repo": "floob",', id="gh_repo"),
pytest.param({}, ".vscode/extensions.json", r'"ms-python.python",', id="no_ide_integ"),
pytest.param({"ide_integration": False}, ".vscode", None, id="ide_integ"),
pytest.param({}, ".github/ISSUE_TEMPLATE/bug_report.yml", r"^labels: bug$", id="default_labels"),
pytest.param(
{"issue_categorization": "labels"},
".github/ISSUE_TEMPLATE/feature_request.yml",
r"^labels: enhancement$",
id="labels",
),
pytest.param(
{"issue_categorization": "issue types"},
".github/ISSUE_TEMPLATE/bug_report.yml",
r"^type: Bug$",
id="issue_types_bug",
),
pytest.param(
{"issue_categorization": "issue types"},
".github/ISSUE_TEMPLATE/feature_request.yml",
r"^type: Enhancement$",
id="issue_types_feature",
),
],
)
def test_build(tmp_path: Path, params: Mapping[str, Any], path: Path | str, pattern: re.Pattern | str | None) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Bug report
description: Report something that is broken or incorrect
{% if cookiecutter.issue_categorization == "issue types" %}
type: Bug
{% else %}
labels: bug
{% endif %}
body:
- type: markdown
attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Feature request
description: Propose a new feature for {{ cookiecutter.project_name }}
{% if cookiecutter.issue_categorization == "issue types" %}
type: Enhancement
{% else %}
labels: enhancement
{% endif %}
body:
- type: textarea
id: description
Expand Down
Loading