Skip to content
Open
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
45 changes: 45 additions & 0 deletions .github/copilot-instructions.md
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.
Copy link
Contributor

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


---

## 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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
- When generating tests, add them to the existing test file for the relevant module.
- One test file for each module.

(Is module the correct term here?)

- Use a new describe block if the function being tested does not already have one.
- Follow existing conventions for test names, structure, and assertions.
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor

Choose a reason for hiding this comment

The 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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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.