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
49 changes: 49 additions & 0 deletions template/.github/ISSUE_TEMPLATE/01-bug-report.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug report
description: Report a problem to help improve this project
title: "[BUG] <Please write a comprehensive title after the '[BUG]' prefix>"
labels: [bug]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I looked for [similar existing issues](https://github.com/{{ git_username }}/{{ project_slug }}/issues).
required: true

- type: textarea
attributes:
label: Problem description
description: |
A concise description of what you're experiencing.
Please explain:
* **what** you tried to achieve,
* **how** you went about it (referring to the code sample), and
* **why** the current behavior is a problem, and what output you expected instead.
validations:
required: false

- type: textarea
attributes:
label: Code sample
description: >
Create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
Please, paste your code between the ``` backticks below or link to a [gist](https://gist.github.com/).
value: |
Code run:
```python
```
Traceback:
```text
```
validations:
required: false

- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
27 changes: 27 additions & 0 deletions template/.github/ISSUE_TEMPLATE/02-question.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Question
description: Ask a question
title: "[Question] <Please write a comprehensive title after the '[Question]' prefix>"
labels: [question]
body:
- type: checkboxes
attributes:
label: Checklist
description: >
To help keep this issue tracker clean and focused, please make sure that you have
tried **all** of the following resources before submitting your question.
options:
- label: I searched the [documentation](https://{{ project_slug }}.readthedocs.io).
required: true
- label: I looked through existing [discussion topics](https://github.com/{{ git_username }}/{{ project_slug }}/discussions).
required: true
Comment on lines +15 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- label: I looked through existing [discussion topics](https://github.com/{{ git_username }}/{{ project_slug }}/discussions).
required: true

we dont use discussions right now, so I would remove this point.

- label: I looked for [similar issues](https://github.com/{{ git_username }}/{{ project_slug }}/issues).
required: true
- label: I looked up my question/problem in a search engine.
required: true

- type: textarea
attributes:
label: Question
description: Please ask your question.
validations:
required: true
49 changes: 49 additions & 0 deletions template/.github/ISSUE_TEMPLATE/03-feature-request.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Feature request
description: Suggest an idea for this project
title: "[ENH] <Please write a comprehensive title after the '[ENH]' prefix>"
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Checklist
description: >
Please make sure you check all these items before submitting your feature request.
options:
- label: There are [no similar issues or pull requests](https://github.com/{{ git_username }}/{{ project_slug }}/issues) for this yet.
required: true

- type: textarea
attributes:
label: Problem
description: >
A clear and concise description of what you are trying to achieve.
placeholder: >
"I want to be able to [...], but I can't because [...]".
validations:
required: false

- type: textarea
attributes:
label: Solution
description: >
A clear and concise description of what you would want to happen.
For API changes, try to provide a code snippet of what you would like the new API to look like.
validations:
required: false

- type: textarea
attributes:
label: Alternatives
description: >
Please describe any alternative solutions or features you've considered to solve
your problem and why they didn't help.
validations:
required: false

- type: textarea
attributes:
label: Anything else?
description: >
Provide any additional context, screenshots, tracebacks, etc. about the feature here.
validations:
required: false
21 changes: 21 additions & 0 deletions template/.github/ISSUE_TEMPLATE/04-documentation.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Documentation
description: Report an issue related to the {{ project_slug }} documentation.
title: "[DOC] <Please write a comprehensive title after the '[DOC]' prefix>"
labels: [documentation]

body:
- type: textarea
attributes:
label: "Issue with current documentation:"
description: >
Please make sure to leave a reference to the document/code you're
referring to. You can also check the development version of the
documentation and see if this issue has already been addressed at
https://{{ project_slug }}.readthedocs.io/en/develop/.
- type: textarea
attributes:
label: "Idea or request for content:"
description: >
Please describe as clearly as possible what topics you think are missing
from the current documentation. Make sure to check the Examples
https://pyfar-gallery.readthedocs.io/en/latest/examples
22 changes: 22 additions & 0 deletions tests/test_copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def test_project_folder(default_project):
"pyproject.toml",
"my_project/__init__.py",
"my_project/my_project.py",
".github/ISSUE_TEMPLATE/01-bug-report.yml",
".github/ISSUE_TEMPLATE/02-question.yml",
".github/ISSUE_TEMPLATE/03-feature-request.yml",
".github/ISSUE_TEMPLATE/04-documentation.yml",
])
def test_generated_file_exists(default_project, file_name):
assert default_project.project_dir.joinpath(file_name).exists()
Expand Down Expand Up @@ -110,3 +114,21 @@ def test_content_project_slug_init(default_project, desired):
content = default_project.project_dir.joinpath('my_project').joinpath(
"__init__.py").read_text()
assert desired in content, f"{desired!r} is not in content"


@pytest.mark.parametrize("file_name", [
".github/ISSUE_TEMPLATE/01-bug-report.yml",
".github/ISSUE_TEMPLATE/02-question.yml",
".github/ISSUE_TEMPLATE/03-feature-request.yml",
])
def test_content_github_issue_template(default_project, file_name):
content = default_project.project_dir.joinpath(file_name).read_text()
desired = 'https://github.com/pyfar/my_project/issues'
assert desired in content, f"{desired!r} is not in content"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function replaces the previous functions test_content_github_02_question() and test_content_github_03_feature_request() and additionally adds a check of the file .github/ISSUE_TEMPLATE/01-bug-report.yml.



def test_content_github_04_documentation(default_project):
content = default_project.project_dir.joinpath(
".github/ISSUE_TEMPLATE/04-documentation.yml").read_text()
desired = 'https://my_project.readthedocs.io/en/develop/.'
assert desired in content, f"{desired!r} is not in content"