We want to make contributing to this project as easy and transparent as possible.
- Active development should happen on your fork of the repositories.
- Name your PR in a way that unambiguously identifies the feature or fix.
- Follow the contribution guide to ensure your code is conformant to the conventions and style.
- Try to make small, logically independent, self-documenting commits (and reflect this in the commit messages by providing brief rationale/change summary).
- We encourage creating draft PRs to gather early feedback.
- Request reviews from at least one Habitat core team member (if the scope of changes necessitates, request from two or more reviewers).
- We have adopted squash-and-merge as the policy for incorporating PRs into the main branch. We encourage more smaller/focused PRs rather than big PRs with many independent changes. This also enables faster development by merging PRs into main quickly and reducing the need to rebase due to changes on main.
- While working on a PR, try to religiously keep your fork up-to-date with main by rebasing as necessary. Note that the above recommendation for smaller and more frequent PRs reduces the burden of rebasing.
- We expect PR ready for final review only if Continuous Integration tests are passing.
- Recommended: after getting a PR through reviews/feedback and is merged into main, delete the branch to de-clutter noise.
- Reach out to us with questions or suggestions on our Slack channel.
In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects. Complete your CLA here.
By contributing to habitat-sim, you agree that your contributions will be licensed under the LICENSE file.
We use semantic versioning. To prepare a release:
- Update version numbers.
- Update the change log.
- Make sure all tests are passing.
- Create a release tag with change log summary using the github release interface (release tag should follow semantic versioning as described above)
Stable versions are regularly assigned by Habitat core team after rigorous testing.
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.
- C++
- In general, we follow C++ Core Guidelines and Google C++ guidelines
- Use
clang-format-12
for style enforcement and linting. Installclang-format-12
throughbrew install clang-format
on macOS. For other systems,clang-format-12
can be installed viaconda install clangdev -c conda-forge
or by downloading binaries or sources from releases.llvm.org/download. For vim integration add to your .vimrc filemap <C-K> :%!clang-format<cr>
and use Ctrl+K to format entire file. Integration plugin for vscode..
- Python
- We follow PEP8 and use typing.
- We use
black
andisort
for linting and code style of python code. Installblack
andisort
throughpip install -U black isort
. They can then be ran viablack .
andisort
.
- JS
- We use
eslint
withprettier
plugin for linting, formatting and code style of JS code. Install these dependencies throughnpm install
. Then, for fixing linting/formatting errors runnpm run lint-fix
. Make sure you have a node version > 8 for this.
- We use
We also use pre-commit hooks to ensure linting and style enforcement. Install the pre-commit hooks with pip install pre-commit && pre-commit install
.
- Our documentation style is based on Magnum / Corrade and uses a similar build system.
- The gfx_batch library is a good example of the documentation style.
- Documentation of PRs is highly encouraged!
- Install
ninja
(sudo apt install ninja-build
on Linux, orbrew install ninja
on macOS) for significantly faster incremental builds - Install
ccache
(sudo apt install ccache
on Linux, orbrew install ccache
on macOS) for significantly faster clean re-builds and builds with slightly different settings - You can skip reinstalling magnum every time by adding the argument of
--skip-install-magnum
to eitherbuild.sh
orsetup.py
. Note that you will still need to install magnum bindings once. - Arguments to
build.sh
andsetup.py
can be cached between subsequent invocations with the flag--cache-args
on the first invocation.