|
| 1 | +# Contributing guide |
| 2 | + |
| 3 | +## Style |
| 4 | + |
| 5 | +We keep code clean and constantly refactoring it for better readability, maintainability, and performance. |
| 6 | +- It is totally fine and encouraged to refactor existing code and send PRs for that. Event if it is a small renaming or a typo fix. |
| 7 | +- Do not mix up refactoring with new features/bug fixes in a single PR. |
| 8 | + |
| 9 | +## AI Generated Code |
| 10 | + |
| 11 | +Of course you can use AI tools to _help_ you write code (who can ban you from that?) but in this case, please make sure to: |
| 12 | +- Manually review and test all AI-generated code before submitting it |
| 13 | +- State clearly in the PR description which parts of the code were generated by AI tools |
| 14 | +- Prefer small, focused AI-generated snippets over large chunks of code |
| 15 | +- Ensure that AI-generated code adheres to the project's coding style and guidelines |
| 16 | + |
| 17 | +> [!WARNING] |
| 18 | +> If we find AI-generated code that is not reviewed or tested, we may ask you to remove it or even close the PR. |
| 19 | +
|
| 20 | +# General |
| 21 | + |
| 22 | +## Dependencies |
| 23 | + |
| 24 | +We prefer to keep dependencies to a minimum so we can control the code quality, build process, and security. Also, we know how slow a compilation can get with too many dependencies. Therefore, if you are thinking about adding a new dependency, please consider checking with the maintainers first. |
| 25 | + |
| 26 | +## Branching Strategy |
| 27 | + |
| 28 | +We use the `main` branch as the default branch and create tags for releases. For new features and bug fixes, please create feature branches from `main` and open pull requests against `main`. |
| 29 | + |
| 30 | +Prior starting work on a PR, please ensure that you have an issue created for it and assinged to yourself. If a scope of work is less than existing issue, create a new issue and link it to the parent one. |
| 31 | + |
| 32 | +## Branch Naming |
| 33 | + |
| 34 | +Make branch names inherit the issue that it addresses. The pattern is: `<issue-number>-<type>-<short-description>`. |
| 35 | + |
| 36 | +Examples: |
| 37 | +- If you work on a new _feature_ "9 - Develop Linker", name your branch `9-feature-develop-linker`. |
| 38 | +- If you work on a _bug fix_ "15 - Fix Parser Crash", name your branch `15-bug-fix-parser-crash`. |
| 39 | + |
| 40 | +## Commit Messages |
| 41 | + |
| 42 | +Please, do not use emoji in commit messages. Keep them simple and descriptive. Avoid tagging people `@` because in case of rebasing or playing with history it may lead to unwanted notifications. |
| 43 | + |
| 44 | +## Clippy |
| 45 | + |
| 46 | +We use `clippy` but sometimes it is too lound. In this case, it is ok to disable specific warnings. |
| 47 | + |
| 48 | +# Code |
| 49 | + |
| 50 | +## Tests |
| 51 | + |
| 52 | +We tend to have as good test coverage as possible. At the same time we keep a balance between writing redundant test that can be make the codebase less readable and maintainable. Please keep in mind this balance when writing tests. |
| 53 | + |
| 54 | +Every PR (except for documentation-only changes and renaming) must include tests that cover the changes made. |
| 55 | + |
| 56 | +### Unit Tests |
| 57 | + |
| 58 | +When writing unit tests, you probably need to have Inference source code as input. In this case, locate the code on top of the test with in a compact format. For example: |
| 59 | + |
| 60 | +```rust |
| 61 | +``` |
| 62 | + |
| 63 | +### Code Generation Tests |
0 commit comments