|
59 | 59 | - `ignore-missing-imports`: Enabled to allow for gradual adoption of type hints without requiring all third-party libraries to have stubs. |
60 | 60 | - `additional_dependencies`: Includes `numpy` and `pandas-stubs` to provide type information for these libraries. |
61 | 61 | - **Execution**: Run automatically via `pre-commit run --all-files` or on commit. |
| 62 | + |
| 63 | +## GitHub Issue Creation |
| 64 | + |
| 65 | +When you or the user identify an issue (bug, enhancement, or task), you can automatically create a GitHub issue using the GitHub CLI. |
| 66 | + |
| 67 | +### Prerequisites |
| 68 | + |
| 69 | +- **Install GitHub CLI**: If `gh` is not available, install it: |
| 70 | + - macOS: `brew install gh` |
| 71 | + - Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md |
| 72 | + - Windows: `winget install --id GitHub.cli` |
| 73 | +- **Authenticate**: Run `gh auth login` and follow the prompts to authorize access to the repository. |
| 74 | + |
| 75 | +### Creating an Issue |
| 76 | + |
| 77 | +1. **Generate the issue body**: Create a markdown file (e.g., `issue.md`) describing the issue with: |
| 78 | + - A clear problem statement or feature request |
| 79 | + - Steps to reproduce (for bugs) |
| 80 | + - Expected vs actual behavior (for bugs) |
| 81 | + - Relevant code snippets or error messages |
| 82 | + - Proposed solution (if applicable) |
| 83 | + |
| 84 | +2. **User review**: Always present the draft issue to the user for review before filing. The user should have the opportunity to view, modify, or approve the issue content before it is submitted. |
| 85 | + |
| 86 | +3. **Create the issue**: After the user approves, run the following command: |
| 87 | + ```bash |
| 88 | + gh issue create --title "<descriptive title>" --body-file issue.md |
| 89 | + ``` |
| 90 | + |
| 91 | + **Adding labels**: Use the `--label` flag to categorize the issue appropriately: |
| 92 | + ```bash |
| 93 | + gh issue create --title "<descriptive title>" --body-file issue.md --label "<label>" |
| 94 | + ``` |
| 95 | + |
| 96 | + Common labels include: |
| 97 | + - `bug` - Something isn't working correctly |
| 98 | + - `enhancement` - New feature or improvement request |
| 99 | + - `documentation` - Documentation improvements or additions |
| 100 | + - `question` - Further information is requested |
| 101 | + |
| 102 | + Multiple labels can be added by repeating the flag: `--label "bug" --label "high priority"` |
| 103 | + |
| 104 | + **Discovering available labels**: To see what labels are available in the repository: |
| 105 | + ```bash |
| 106 | + # List all labels defined in the repo, along with their descriptions |
| 107 | + gh label list --limit 100 |
| 108 | + |
| 109 | + # Find unique labels from existing issues |
| 110 | + gh issue list --state all --limit 100 --json labels --jq '.[].labels[].name' | sort -u |
| 111 | + ``` |
| 112 | + |
| 113 | +4. **Clean up**: Delete the temporary `issue.md` file after the issue is created. |
0 commit comments