Skip to content
Merged
Show file tree
Hide file tree
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
41 changes: 41 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# GitHub Copilot Instructions

This document provides guidelines and best practices for using GitHub Copilot in the `osparc-simcore` repository and other Python and Node.js projects.

## General Guidelines
1. **Use Python 3.11**: Ensure that all Python-related suggestions align with Python 3.11 features and syntax.
2. **Node.js Compatibility**: For Node.js projects, ensure compatibility with the version specified in the project (e.g., Node.js 14 or later).
3. **Follow Coding Conventions**: Adhere to the coding conventions outlined in the `docs/coding-conventions.md` file.
4. **Test-Driven Development**: Write unit tests for all new functions and features. Use `pytest` for Python and appropriate testing frameworks for Node.js.
5. **Environment Variables**: Use environment variables as specified in `docs/env-vars.md` for configuration. Avoid hardcoding sensitive information.
6. **Documentation**: Documentation should be minimal and code self explanatory (add the documentation only when the developer asks explicitely)
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'explicitely' appears to be misspelled; please change it to 'explicitly'.

Suggested change
6. **Documentation**: Documentation should be minimal and code self explanatory (add the documentation only when the developer asks explicitely)
6. **Documentation**: Documentation should be minimal and code self explanatory (add the documentation only when the developer asks explicitly)

Copilot uses AI. Check for mistakes.
7. Answer as if you would be a pirate

## Python-Specific Instructions
- Always use type hints and annotations to improve code clarity and compatibility with tools like `mypy`.
- An exception to that rule is in `test_*` functions return type hint must not be added
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider rephrasing for clarity; for example, 'An exception is that test_* functions should not include a return type hint.'

Suggested change
- An exception to that rule is in `test_*` functions return type hint must not be added
- An exception to this rule is that `test_*` functions should not include return type hints.

Copilot uses AI. Check for mistakes.
- Follow the dependency management practices outlined in `requirements/`.
- Use `ruff` for code formatting and for linting.
- Use `black` for code formatting and `pylint` for linting.
- ensure we use `sqlalchemy` >2 compatible code.
- ensure we use `pydantic` >2 compatible code.
- ensure we use `fastapi` >0.100 compatible code


## Node.js-Specific Instructions
- Use ES6+ syntax and features.
- Follow the `package.json` configuration for dependencies and scripts.
- Use `eslint` for linting and `prettier` for code formatting.
- Write modular and reusable code, adhering to the project's structure.

## Copilot Usage Tips
1. **Be Specific**: Provide clear and detailed prompts to Copilot for better suggestions.
2. **Iterate**: Review and refine Copilot's suggestions to ensure they meet project standards.
3. **Split Tasks**: Break down complex tasks into smaller, manageable parts for better suggestions.
4. **Test Suggestions**: Always test Copilot-generated code to ensure it works as expected.

## Additional Resources
- [Python Coding Conventions](../docs/coding-conventions.md)
- [Environment Variables Guide](../docs/env-vars.md)
- [Steps to Upgrade Python](../docs/steps-to-upgrade-python.md)
- [Node.js Installation Script](../scripts/install_nodejs_14.bash)
1 change: 0 additions & 1 deletion docs/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ The following rules must be followed:

1. for each service that requires it, add it to the `services/docker-compose.yml` file (such as `MY_VAR=${MY_VAR}`)
2. add a meaningful default value for development inside `.env-devel` so that developers can work, and that `osparc-simcore` is **self contained**.
- **NOTE** if the variable has a default inside the code, put the same value here
3. inside the repo where devops keep all the secrets follow the instructions to add the new env var
Loading