Add complete type hints to all public methods and functions #69
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
| name: π€ Copilot Feature Factory | |
| on: | |
| issues: | |
| types: [labeled] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| # ------------------------------------------------------------------ | |
| # NOTIFY AND CREATE TRACKING ISSUE | |
| # ------------------------------------------------------------------ | |
| create-implementation-task: | |
| if: github.event.label.name == 'copilot-build' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: π¬ Guide User to Copilot Edits | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issueNumber = ${{ github.event.issue.number }}; | |
| const issueTitle = `${{ github.event.issue.title }}`; | |
| const issueBody = `${{ github.event.issue.body }}`; | |
| // Create a formatted prompt for Copilot Edits | |
| const copilotPrompt = `Implement the feature from Issue #${issueNumber}: | |
| **Title**: ${issueTitle} | |
| **Requirements**: | |
| ${issueBody} | |
| **Technical Guidelines**: | |
| - Follow existing code patterns in the repository | |
| - Add appropriate error handling and validation | |
| - Include docstrings and type hints (Python) | |
| - Ensure code follows PEP 8 style guidelines | |
| - Add tests if applicable | |
| - Update documentation as needed | |
| **Project Context**: | |
| - This is a Python-based Practice Questions Platform | |
| - Uses pandas for data processing | |
| - Generates SQL practice questions | |
| - Follow the existing project structure in infra/ and src/ directories`; | |
| // Comment with instructions | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| body: `## π€ Copilot Feature Factory Activated! | |
| This issue has been marked for Copilot-assisted implementation. Here's how to proceed: | |
| ### Option 1: Use GitHub Copilot Edits (Recommended) | |
| 1. **Open this repository** in VS Code or your preferred editor | |
| 2. **Start Copilot Edits** (Ctrl+Shift+I or Cmd+Shift+I) | |
| 3. **Copy and paste** the following prompt: | |
| \`\`\` | |
| ${copilotPrompt} | |
| \`\`\` | |
| 4. **Review the changes** Copilot suggests | |
| 5. **Commit and push** when satisfied | |
| 6. **Create a Pull Request** referencing this issue | |
| ### Option 2: Use GitHub Copilot Chat | |
| 1. Open the repository in your editor | |
| 2. Use **@workspace** in Copilot Chat | |
| 3. Ask: "Implement the feature described in Issue #${issueNumber}" | |
| 4. Review and apply suggested changes | |
| ### Option 3: Manual Implementation with Copilot Assistance | |
| 1. Create a new branch: \`git checkout -b feature/issue-${issueNumber}\` | |
| 2. Use Copilot inline suggestions as you code | |
| 3. Commit your changes | |
| 4. Push and create a PR | |
| --- | |
| **π Ready-to-Use Copilot Prompt:** | |
| <details> | |
| <summary>Click to expand full prompt</summary> | |
| \`\`\` | |
| ${copilotPrompt} | |
| \`\`\` | |
| </details> | |
| --- | |
| π‘ **Tip**: The more specific your issue description, the better Copilot's suggestions will be! | |
| Remove the \`copilot-build\` label once you start working on this to avoid duplicate notifications.` | |
| }); | |
| - name: π·οΈ Add Status Label | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // Add a "copilot-ready" label | |
| try { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ github.event.issue.number }}, | |
| labels: ['copilot-ready'] | |
| }); | |
| } catch (error) { | |
| // Label might not exist, create it | |
| console.log('Label might not exist, continuing...'); | |
| } | |