diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56b106a..4c77143 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,16 +48,17 @@ The first time you run `hatch shell` the environment will be created and activat > > This will make hatch set up its environments within the current working directory under `.venv`. -Alternatively, if you prefer to manage your virtual environments differently, you can install the package for development using, for example: +Alternatively, if you prefer to manage your virtual environments yourself, you can install the package for development using, for example: ```sh python -m venv .venv +source ./.venv/bin/activate pip install -e '.[dev,test,docs]' ``` For all pull requests, linting and unit tests are automatically run using the [GitHub Actions](https://docs.github.com/en/actions) Continuous Integration service. However, you are still encouraged to run these checks locally before pushing code to a PR. -## Linting and formatting +## Linting and Formatting We use [ruff](https://docs.astral.sh/ruff/) for style checking. Run `ruff check .` or: @@ -71,11 +72,7 @@ Ruff can fix a lot of errors itself. Run `ruff check --fix .` or: hatch run fix ``` -Ruff includes a formatter that mimics [black](https://black.readthedocs.io/en/stable/). To automatically reformat your code, you can use `ruff format .` or: - -```sh -hatch run format -``` +Ruff includes a formatter that mimics [black](https://black.readthedocs.io/en/stable/). To automatically reformat your code, you can use `ruff format {source_file}`. We use [pre-commit](https://github.com/pre-commit/pre-commit) to make sure the coding style is enforced. You first need to install pre-commit and the corresponding git commit hooks: