-
Notifications
You must be signed in to change notification settings - Fork 4
chore: add initial Copilot instructions file TDE-1663 #1279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||
| # GitHub Copilot Project Instructions | ||||||
|
|
||||||
| This file provides guidelines and instructions for using GitHub Copilot in this project. Amend and maintain this file as needed to help Copilot generate code and documentation that matches this project's standards and requirements. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## General Coding Standards | ||||||
|
|
||||||
| - Follow the TypeScript style defined in `@linzjs/style/tsconfig.base.json`. | ||||||
| - Use ES2022 features as per `tsconfig.json`. | ||||||
| - Prefer functional, modular code. | ||||||
| - Add JSDoc comments for exported functions and classes. | ||||||
| - Use descriptive variable and function names. | ||||||
|
|
||||||
| ## Logging | ||||||
|
|
||||||
| - Use the `logger` utility for all logging. | ||||||
| - Always log the source file or context when reporting errors. | ||||||
| - Avoid duplicate error logs for the same failure. | ||||||
|
|
||||||
| ## Error Handling | ||||||
|
|
||||||
| - Throw errors with clear, actionable messages. | ||||||
| - Include relevant context (e.g., file name, operation) in error logs. | ||||||
|
|
||||||
| ## Testing | ||||||
|
|
||||||
| - Use the `node:test` framework and `assert` for assertions. | ||||||
| - When generating tests, add them to the existing test file for the relevant module. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, we may need to be more succinct for this to be an effective prompt?
Suggested change
(Is |
||||||
| - Use a new describe block if the function being tested does not already have one. | ||||||
| - Follow existing conventions for test names, structure, and assertions. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we instead ask to align with existing conventions and harmonize/implement best practice where existing code deviates? |
||||||
|
|
||||||
| ## Commit & Branch Naming | ||||||
|
|
||||||
| - Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||||||
| - Example commit: `fix(tileindex-validate): log source file on geo transform error` | ||||||
| - Example branch: `fix/log-tiff-source-on-geo-transform-error-tde-1677` | ||||||
|
|
||||||
| ## Copilot Usage | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is for copilot, not for us devs, so shouldn't contain instructions for us how to use copilot?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I was thinking that an example would be good but as you say maybe this section shouldn't be here at all. |
||||||
|
|
||||||
| - When asking Copilot for code, specify: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An example could be good here. |
||||||
| - File location | ||||||
| - Expected input/output | ||||||
| - Any relevant context or standards | ||||||
| - Review Copilot suggestions for style and correctness before merging. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this from a sample file? Might need to be removed