|
1 |
| -# Contributing to [project-title] |
| 1 | +# Contributing |
2 | 2 |
|
3 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
4 | 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
15 | 15 | - [Code of Conduct](#coc)
|
16 | 16 | - [Issues and Bugs](#issue)
|
17 | 17 | - [Feature Requests](#feature)
|
18 |
| - - [Submission Guidelines](#submit) |
| 18 | + - [Submitting a PR](#submit-pr) |
| 19 | + - [Running Tests](#tests) |
| 20 | + - [Code Style](#style) |
19 | 21 |
|
20 | 22 | ## <a name="coc"></a> Code of Conduct
|
21 | 23 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
@@ -51,26 +53,64 @@ chances of your issue being dealt with quickly:
|
51 | 53 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
|
52 | 54 | causing the problem (line of code or commit)
|
53 | 55 |
|
54 |
| -You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/Azure-Samples/rag-postgres-openai-python/issues/new]. |
| 56 | +You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/Azure-samples/rag-postgres-openai-python/issues/new]. |
55 | 57 |
|
56 | 58 | ### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
57 | 59 | Before you submit your Pull Request (PR) consider the following guidelines:
|
58 | 60 |
|
59 |
| -* Search the repository (https://github.com/Azure-Samples/rag-postgres-openai-python/pulls) for an open or closed PR |
| 61 | +* Search the repository (https://github.com/Azure-samples/rag-postgres-openai-python/pulls) for an open or closed PR |
60 | 62 | that relates to your submission. You don't want to duplicate effort.
|
61 |
| - |
62 | 63 | * Make your changes in a new git fork
|
| 64 | +* Follow [Code style conventions](#style) |
| 65 | +* [Run the tests](#tests) (and write new ones, if needed) |
63 | 66 | * Commit your changes using a descriptive commit message
|
64 | 67 | * Push your fork to GitHub
|
65 |
| -* In GitHub, create a pull request |
66 |
| -* If we suggest changes then: |
67 |
| - * Make the required updates. |
68 |
| - * Rebase your fork and force push to your GitHub repository (this will update your Pull Request): |
| 68 | +* In GitHub, create a pull request to the `main` branch of the repository |
| 69 | +* Ask a maintainer to review your PR and address any comments they might have |
| 70 | + |
| 71 | +## <a name="tests"></a> Setting up the development environment |
| 72 | + |
| 73 | +Install the development dependencies: |
| 74 | + |
| 75 | +``` |
| 76 | +python3 -m pip install -r requirements-dev.txt |
| 77 | +``` |
| 78 | + |
| 79 | +Install the pre-commit hooks: |
| 80 | + |
| 81 | +``` |
| 82 | +pre-commit install |
| 83 | +``` |
| 84 | + |
| 85 | +Compile the JavaScript: |
| 86 | + |
| 87 | +``` |
| 88 | +( cd ./app/frontend ; npm install ; npm run build ) |
| 89 | +``` |
| 90 | + |
| 91 | +## <a name="style"></a> Code Style |
| 92 | + |
| 93 | +This codebase includes several languages: TypeScript, Python, Bicep, Powershell, and Bash. |
| 94 | +Code should follow the standard conventions of each language. |
| 95 | + |
| 96 | +For Python, you can enforce the conventions using `ruff`. |
| 97 | + |
| 98 | +Install the development dependencies: |
| 99 | + |
| 100 | +``` |
| 101 | +python3 -m pip install -r requirements-dev.txt |
| 102 | +``` |
| 103 | + |
| 104 | +Run `ruff` to lint a file: |
| 105 | + |
| 106 | +``` |
| 107 | +python3 -m ruff check <path-to-file> |
| 108 | +``` |
69 | 109 |
|
70 |
| - ```shell |
71 |
| - git rebase master -i |
72 |
| - git push -f |
73 |
| - ``` |
| 110 | +Run `ruff` to format a file: |
74 | 111 |
|
75 |
| -That's it! Thank you for your contribution! |
| 112 | +``` |
| 113 | +python3 -m ruff format <path-to-file> |
| 114 | +``` |
76 | 115 |
|
| 116 | +If you followed the steps above to install the pre-commit hooks, then you can just wait for those hooks to run `ruff` for you. |
0 commit comments