|
4 | 4 |
|
5 | 5 | <!-- TOC start (generated with https://github.com/derlin/bitdowntoc) --> |
6 | 6 |
|
7 | | -- [</a> Have a Question?](#have-a-question) |
8 | | -- [</a> Found a Bug?](#found-a-bug) |
9 | | -- [</a> Have a Feature Request?](#have-a-feature-request) |
10 | | -- [Alternative ways of contributing](#alternative-ways-of-contributing) |
11 | | -- [</a> Ready to Contribute!](#ready-to-contribute) |
12 | | - * [Installation](#installation) |
13 | | - * [Some UV commands](#some-uv-commands) |
14 | | - * [Tests](#tests) |
15 | | - * [Stress your computer](#stress-your-computer) |
16 | | - * [Update all dependancies](#update-all-dependancies) |
17 | | - * [Branching and Pull Requests](#branching-and-pull-requests) |
18 | | - * [Debug in VS Code](#debug-in-vs-code) |
19 | | - * [Coding style && Linting](#coding-style-linting) |
20 | | - * [Dependencies management](#dependencies-management) |
21 | | - * [Build Documentation 🖨️](#build-documentation) |
22 | | - * [Release process](#release-process) |
23 | | - + [Test the build in Docker](#test-the-build-in-docker) |
24 | | -- [API and Dashboard](#api-and-dashboard) |
25 | | - * [CSV Dashboard](#csv-dashboard) |
26 | | - * [Web dashboard](#web-dashboard) |
27 | | - * [API](#api) |
28 | | - * [Test the API](#test-the-api) |
29 | | - * [Restore database from a production Backup](#restore-database-from-a-production-backup) |
30 | | - * [Deployment](#deployment) |
31 | | - + [API](#api-1) |
32 | | - + [Dashboard](#dashboard) |
33 | | -- [License](#license) |
| 7 | +- [Contributing to Code Carbon](#contributing-to-code-carbon) |
| 8 | + - [ Have a Question?](#-have-a-question) |
| 9 | + - [ Found a Bug?](#-found-a-bug) |
| 10 | + - [ Have a Feature Request?](#-have-a-feature-request) |
| 11 | + - [Alternative ways of contributing](#alternative-ways-of-contributing) |
| 12 | + - [ Ready to Contribute!](#-ready-to-contribute) |
| 13 | + - [Installation](#installation) |
| 14 | + - [Some UV commands](#some-uv-commands) |
| 15 | + - [Tests](#tests) |
| 16 | + - [Stress your computer](#stress-your-computer) |
| 17 | + - [Update all dependancies](#update-all-dependancies) |
| 18 | + - [Branching and Pull Requests](#branching-and-pull-requests) |
| 19 | + - [Debug in VS Code](#debug-in-vs-code) |
| 20 | + - [Coding style \&\& Linting](#coding-style--linting) |
| 21 | + - [Dependencies management](#dependencies-management) |
| 22 | + - [Build Documentation 🖨️](#build-documentation-️) |
| 23 | + - [Release process](#release-process) |
| 24 | + - [Test the build in Docker](#test-the-build-in-docker) |
| 25 | + - [API and Dashboard](#api-and-dashboard) |
| 26 | + - [CSV Dashboard](#csv-dashboard) |
| 27 | + - [Web dashboard](#web-dashboard) |
| 28 | + - [API](#api) |
| 29 | + - [Test the API](#test-the-api) |
| 30 | + - [Restore database from a production Backup](#restore-database-from-a-production-backup) |
| 31 | + - [Deployment](#deployment) |
| 32 | + - [API](#api-1) |
| 33 | + - [Dashboard](#dashboard) |
| 34 | + - [License](#license) |
34 | 35 |
|
35 | 36 | <!-- TOC end --> |
36 | 37 |
|
@@ -225,7 +226,7 @@ Here is the launch.json to be able to debug examples and tests: |
225 | 226 |
|
226 | 227 | Then run opened test with this button: |
227 | 228 |
|
228 | | - |
| 229 | + |
229 | 230 |
|
230 | 231 |
|
231 | 232 | <!-- TOC --><a name="coding-style-linting"></a> |
@@ -271,15 +272,40 @@ Dependencies are defined in different places: |
271 | 272 | ### Build Documentation 🖨️ |
272 | 273 |
|
273 | 274 | No software is complete without great documentation! |
274 | | -To make generating documentation easier, we use [`sphinx` package](https://www.sphinx-doc.org/en/master/usage/installation.html#installation-from-pypi). |
| 275 | +To make generating documentation easier, we use [Zensical](https://zensical.org/). |
275 | 276 |
|
276 | | -In order to make changes, edit the `.rst` files that are in the `/docs/edit` folder, and then run in root folder: |
| 277 | +In order to make changes, edit the `.md` files in the `/docs` folder, and then run in root folder: |
277 | 278 |
|
278 | 279 | ```sh |
279 | 280 | uv run --only-group doc task docs |
280 | 281 | ``` |
281 | 282 |
|
282 | | -to regenerate the html files. |
| 283 | +to regenerate the html files. For local preview with live reload, run `uv run --only-group doc task docs-serve`. |
| 284 | + |
| 285 | +### Rebase your branch on master |
| 286 | + |
| 287 | +Before creating a PR, please make sure to rebase your branch on master to avoid merge conflicts and make the review easier. You can do it with the following command: |
| 288 | +```sh |
| 289 | +# Be careful, this command will delete every local changes you have, make sure to commit or stash them before running it |
| 290 | +TARGET_BRANCH=master |
| 291 | +current_branch=$(git symbolic-ref --short HEAD) |
| 292 | +git switch $TARGET_BRANCH && git pull |
| 293 | +git switch $current_branch --force && git fetch origin $TARGET_BRANCH |
| 294 | +git rebase $TARGET_BRANCH |
| 295 | +``` |
| 296 | + |
| 297 | +In case of a conflict during a rebase, "incoming" refers to your branch, and "current" refers to master. This is because the commits from your branch are being applied to master, so they are incoming. In case of a merge, it's the opposite! |
| 298 | + |
| 299 | +Check if everything is fine: |
| 300 | + |
| 301 | +```sh |
| 302 | +git status |
| 303 | +``` |
| 304 | + |
| 305 | +Push force |
| 306 | +```sh |
| 307 | +git push --force-with-lease |
| 308 | +``` |
283 | 309 |
|
284 | 310 | ### Rebase your branch on master |
285 | 311 |
|
@@ -313,7 +339,7 @@ git push --force-with-lease |
313 | 339 | - Create a PR bumping the version with `uv run bumpver update --patch`. For a release candidate, use `uv run bumpver update --set-version 3.0.0_rc1`. |
314 | 340 | - Run `uv run python .github/pyproject_versions.py -c` to check version consistancy. |
315 | 341 | - Update the dependencies with `uv sync --upgrade` |
316 | | -- [Build Documentation](#documentation) with `uv run --only-group doc task docs`. |
| 342 | +- [Build Documentation](#build-documentation) with `uv run --only-group doc task docs`. |
317 | 343 | - Push the changes. |
318 | 344 | - Merge the PR. |
319 | 345 | - Wait for the Github Action `ReleaseDrafter` to finish running on the merge commit. |
|
0 commit comments