Github Development Guide#
Branch Naming
feature/: For developing new features.
bugfix/: To fix bugs in the code. Often created associated to an issue.
hotfix/: To fix critical bugs in the production.
release/: To prepare a new release, typically used to do tasks such as last touches and revisions.
docs/: Used to write, modify or correct documentation.
Rebasing
Follow these steps to rebase your branch onto the latest version of the main branch.
Fetch the latest updates from the remote repository:
git fetchSwitch to the branch you want to rebase:
git checkout your_branch
Rebase your branch onto the latest version of:
maingit rebase origin/main
Resolve any conflicts if any:
Manually resolve conflicts in files.
After resolving, stage the changes:
git add .
Continue the rebase process:
git rebase --continue
Verify the rebasing:
Once you see the message confirming a successful rebase, your branch is now rebased onto
main.
Code Quality and Pre-Commit Hooks
Mandatory Pre-Commit Checks (Required for PR)
To ensure your code meets quality standards and passes all Continuous Integration (CI) checks, you must install and run the pre-commit hooks locally before pushing your changes for a Pull Request.
Install pre-commit:
pip install pre-commit
Install the git hooks into your repository:
pre-commit installManually run hooks against all files (for initial setup and cleanup):
pre-commit run --all-files
Note
After installation, the hooks will run automatically on every
git commit.
Locally Compile documentation
To compile the documentation locally, follow these steps:
Install Sphinx and necessary extensions:
pip install -r docs/requirements_docs.txt
Install pandoc markup converter:
On macOS, you can use Homebrew:
brew install pandoc
On Ubuntu/Debian, you can use apt-get:
sudo apt-get install pandoc
Build the documentation:
sphinx-build -b html docs docs/_build/html
View the documentation: Open the generated HTML files in your web browser:
On macOS, you can use the open command:
open docs/_build/html/index.htmlOn Linux, you can use xdg-open:
xdg-open docs/_build/html/index.html
Tips and Tools
Enable Git Autocomplete on macOS
Add the following command to
~/.zshrc:autoload -Uz compinit && compinit
Activate the changes:
source ~/.zshrc
Run Memory Check on macOS
leaks --atExit -- bin/run_tests
Code Formatting in VS Code
To maintain code consistency, add the following settings to your .vscode/settings.json:
{
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 80 }",
"editor.rulers": [80],
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", 80],
"editor.trimAutoWhitespace": true,
"files.trimTrailingWhitespace": true,
"C_Cpp.errorSquiggles": "disabled"
}