|
| 1 | +# Copilot Instructions |
| 2 | + |
| 3 | +## Environment Setup |
| 4 | + |
| 5 | +Install dependencies by running: |
| 6 | + |
| 7 | +```bash |
| 8 | +npm install |
| 9 | +``` |
| 10 | + |
| 11 | +## Testing |
| 12 | + |
| 13 | +Ensure all unit tests pass by running: |
| 14 | + |
| 15 | +```bash |
| 16 | +npm run test |
| 17 | +``` |
| 18 | + |
| 19 | +Unit tests should exist in the `__tests__` directory. They are powered by |
| 20 | +`jest`. Fixtures should be placed in the `__fixtures__` directory. |
| 21 | + |
| 22 | +## General Coding Guidelines |
| 23 | + |
| 24 | +- Follow standard TypeScript and JavaScript coding conventions and best |
| 25 | + practices |
| 26 | +- Changes should maintain consistency with existing patterns and style |
| 27 | +- Document changes clearly and thoroughly, including updates to existing |
| 28 | + comments when appropriate |
| 29 | +- Do not include basic, unnecessary comments that simply restate what the code |
| 30 | + is doing (focus on explaining _why_, not _what_) |
| 31 | +- Use consistent error handling patterns throughout the codebase |
| 32 | +- Use TypeScript's type system to ensure type safety and clarity |
| 33 | +- Keep functions focused and manageable |
| 34 | +- Use descriptive variable and function names that clearly convey their purpose |
| 35 | +- Use JSDoc comments to document functions, classes, and complex logic |
| 36 | +- After doing any refactoring, ensure to run `npm run test` to ensure that all |
| 37 | + tests still pass and coverage requirements are met |
| 38 | +- When suggesting code changes, always opt for the most maintainable approach. |
| 39 | + Try your best to keep the code clean and follow "Don't Repeat Yourself" (DRY) |
| 40 | + principles |
| 41 | +- Avoid unnecessary complexity and always consider the long-term maintainability |
| 42 | + of the code |
| 43 | +- When writing unit tests, try to consider edge cases as well as the main path |
| 44 | + of success. This will help ensure that the code is robust and can handle |
| 45 | + unexpected inputs or situations |
| 46 | + |
| 47 | +### Versioning |
| 48 | + |
| 49 | +GitHub Actions are versioned using branch and tag names. Please ensure the |
| 50 | +version in the project's `package.json` is updated to reflect the changes made |
| 51 | +in the codebase. The version should follow |
| 52 | +[Semantic Versioning](https://semver.org/) principles. |
| 53 | + |
| 54 | +## Pull Request Guidelines |
| 55 | + |
| 56 | +When creating a pull request (PR), please ensure that: |
| 57 | + |
| 58 | +- Keep changes focused and minimal (avoid large changes, or consider breaking |
| 59 | + them into separate, smaller PRs) |
| 60 | +- Formatting checks pass |
| 61 | +- Linting checks pass |
| 62 | +- Unit tests pass and coverage requirements are met |
| 63 | +- If necessary, the `README.md` file is updated to reflect any changes in |
| 64 | + functionality or usage |
| 65 | + |
| 66 | +The body of the PR should include: |
| 67 | + |
| 68 | +- A summary of the changes |
| 69 | +- A special note of any changes to dependencies |
| 70 | +- A link to any relevant issues or discussions |
| 71 | +- Any additional context that may be helpful for reviewers |
| 72 | + |
| 73 | +## Code Review Guidelines |
| 74 | + |
| 75 | +When performing a code review, please follow these guidelines: |
| 76 | + |
| 77 | +- If there are changes that modify the functionality/usage of the action, |
| 78 | + validate that there are changes in the `README.md` file that document the new |
| 79 | + or modified functionality |
0 commit comments