diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdee7ae..d8f8938 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ If you are proposing a feature: Ready to contribute? Here's how to set up `reject` for local development. -1. Download a copy of `reject` locally. +1. Clone the `reject` repository locally. 2. Install `reject` using `poetry`: ```console @@ -59,6 +59,30 @@ Ready to contribute? Here's how to set up `reject` for local development. 5. Commit your changes and open a pull request. +## Pre-commit hooks + +A handful of [pre-commit](https://pre-commit.com) hooks are provided, and ensuring their checks pass pass is highly recommended as they are later ran as part of CI checks that will block PRs. + +These hooks include: + +* Trailing whitespace trimming. +* Ensure EOF newline. +* Code formatting ([black](https://github.com/psf/black)). +* PEP8 linting ([flake8](https://github.com/pycqa/flake8)). +* Import sorting ([isort](https://github.com/PyCQA/isort)). + +All *pre-commit* hooks can be installed with: + +```shell +pre-commit install +``` + +Alternatively, all of the aforementioned tools are installed with the *dev* dependency group and can ran individually, without *pre-commit* hooks. For example, to format files with *black*: + +```shell +poetry run black reject/ +``` + ## Pull Request Guidelines Before you submit a pull request, check that it meets these guidelines: @@ -66,8 +90,3 @@ Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include additional tests if appropriate. 2. If the pull request adds functionality, the docs should be updated. 3. The pull request should work for all currently supported operating systems and versions of Python. - -## Code of Conduct - -Please note that the `reject` project is released with a -Code of Conduct. By contributing to this project you agree to abide by its terms. diff --git a/TODO.md b/TODO.md index 4ade909..10b8cda 100644 --- a/TODO.md +++ b/TODO.md @@ -3,15 +3,14 @@ Functionalities for classification with rejection. ### Todo -- [ ] Write development page (see [example](https://airflow-dbt-python.readthedocs.io/en/latest/development.html)) - [ ] Change sphinx theme - [ ] Inspect how sklearn creates plot ([here](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.PrecisionRecallDisplay.html#sklearn.metrics.PrecisionRecallDisplay.from_estimator)) - [ ] Test code for a range of python versions -- [ ] Which linters to use? Pylint, Flake8, black? - +- [ ] Maybe add flake8 to github actions +- [ ] Maybe add mypy to pre-commit hooks and add to CONTRIBUTING.md "* Static type checking ([mypy](https://github.com/python/mypy))." ### In Progress -- [ ] Use pre-commit hooks (also see [example](https://airflow-dbt-python.readthedocs.io/en/latest/development.html#pre-commit-hooks)) + ### Done ✓ - [x] Use Literal types in type hints @@ -21,3 +20,6 @@ Functionalities for classification with rejection. - [x] Update PyPi description to regular README - [x] Fix bug in documentation build: ModuleNotFoundError - [x] Check sphinx-build command +- [x] Which linters to use? Pylint, Flake8, black? +- [x] Use pre-commit hooks (also see [example](https://airflow-dbt-python.readthedocs.io/en/latest/development.html#pre-commit-hooks)) +- [x] Update development page (see [example](https://airflow-dbt-python.readthedocs.io/en/latest/development.html))