diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04f1af04..c010bb8f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,24 +61,45 @@ Optionally, specify `html-noplot` instead of `html` to avoid running the tutoria ### Guidelines -We are using `ruff` for code formatting, linting, and imports (as a drop-in +#### Commits + +We are use `ruff` for code formatting, linting, and imports (as a drop-in replacement for `black`, `isort`, and `flake8`). The `pre-commit` hooks will ensure that your code is properly formatted and linted before committing. -To make your changes, create a branch on a personal fork, whose name is not -dev nor main. +Please ensure that the tests are passing on your machine before pushing on a +PR. This will avoid multiplying the number featureless commits. To do this, +run, at the root of the folder: -Before submitting a final pull request, that we will review, please try your -best not to reduce the code coverage and document your code. +```sh +python3 -m pytest tests +``` Try to include an emoji at the start of each commit message following the suggestions from [this page](https://gist.github.com/parmentf/035de27d6ed1dce0b36a). -If you implement a method, please add a reference to the corresponding paper in the -["References" page](https://torch-uncertainty.github.io/references.html). Also, -remember to add TorchUncertainty to the list of libraries implementing this reference +#### Pull requests + +To make your changes, create a branch on a personal fork and create a PR when your contribution +is mostly finished or if you need help. + +Check that your PR complies with the following conditions: + +- The name of your branch is not `main` nor `dev` (see issue #58) +- Your PR does not reduce the code coverage +- Your code is documented: the function signatures are typed, and the main functions have clear +docstrings +- Your code is mostly original, and the parts coming from licensed sources are explicitly +stated as such +- If you implement a method, please add a reference to the corresponding paper in the +["References" page](https://torch-uncertainty.github.io/references.html). +- Also, remember to add TorchUncertainty to the list of libraries implementing this reference on [PapersWithCode](https://paperswithcode.com). +If you need help to implement a method, increase the coverage, or solve ruff-raised errors, +create the PR with the `need-help` flag and explain your problems in the comments. A maintainer +will do their best to help you. + ### Datasets & Datamodules We intend to include datamodules for the most popular datasets only. diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 1cb1c12a..4f157be4 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -63,24 +63,44 @@ Optionally, specify :bash:`html-noplot` instead of :bash:`html` to avoid running Guidelines ^^^^^^^^^^ -We are using ruff for code formatting, linting, and imports (as a drop-in +**Commits** + +We use ruff for code formatting, linting, and imports (as a drop-in replacement for black, isort, and flake8). The pre-commit hooks will ensure that your code is properly formatted and linted before committing. -To make your changes, create a branch on a personal fork, whose name is not -dev nor main. +Please ensure that the tests are passing on your machine before pushing on a +PR. This will avoid multiplying the number featureless commits. To do this, +run, at the root of the folder: -Before submitting a final pull request, that we will review, please try your -best not to reduce the code coverage and do document your code. +.. parsed-literal:: + + python3 -m pytest tests Try to include an emoji at the start of each commit message following the suggestions from `this page `_. -If you implement a method, please add a reference to the corresponding paper in the -`references page `_. Also, -remember to add TorchUncertainty to the list of libraries implementing this reference +**Pull requests** + +To make your changes, create a branch on a personal fork and create a PR when your contribution +is mostly finished or if you need help. + +Check that your PR complies with the following conditions: +* The name of your branch is not `main` nor `dev` (see issue #58) +* Your PR does not reduce the code coverage +* Your code is documented: the function signatures are typed, and the main functions have clear +docstrings +* Your code is mostly original, and the parts coming from licensed sources are explicitly +stated as such +* If you implement a method, please add a reference to the corresponding paper in the +`references page `_. +* Also, remember to add TorchUncertainty to the list of libraries implementing this reference on `PapersWithCode `_. +If you need help to implement a method, increase the coverage, or solve ruff-raised errors, +create the PR with the `need-help` flag and explain your problems in the comments. A maintainer +will do their best to help you. + Datasets & Datamodules ^^^^^^^^^^^^^^^^^^^^^^