Skip to content

Commit b46897a

Browse files
committed
docs: Update contributing guidelines
1 parent c8ed644 commit b46897a

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

CONTRIBUTING.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ The first time you run `hatch shell` the environment will be created and activat
4848
>
4949
> This will make hatch set up its environments within the current working directory under `.venv`.
5050
51-
Alternatively, if you prefer to manage your virtual environments differently, you can install the package for development using, for example:
51+
Alternatively, if you prefer to manage your virtual environments yourself, you can install the package for development using, for example:
5252
5353
```sh
5454
python -m venv .venv
55+
source .venv/bin/activate
5556
pip install -e '.[dev,test,docs]'
5657
```
5758
5859
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.
5960
60-
## Linting and formatting
61+
## Linting and Formatting
6162
6263
We use [ruff](https://docs.astral.sh/ruff/) for style checking. Run `ruff check .` or:
6364
@@ -71,11 +72,7 @@ Ruff can fix a lot of errors itself. Run `ruff check --fix .` or:
7172
hatch run fix
7273
```
7374
74-
Ruff includes a formatter that mimics [black](https://black.readthedocs.io/en/stable/). To automatically reformat your code, you can use `ruff format .` or:
75-
76-
```sh
77-
hatch run format
78-
```
75+
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}`.
7976
8077
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:
8178
@@ -84,15 +81,13 @@ pip install pre-commit
8481
pre-commit install
8582
```
8683
87-
After that you can make sure your code satisfies the coding style:
84+
The last command installs the hooks listed in `.pre-commit-config.yaml` locally into your git repo. If you do this, the checks will run automatically before every commit. You can also manually make sure your code satisfies the coding style:
8885
8986
```sh
9087
pre-commit run --all-files
9188
```
9289
93-
If you install pre-commit in your repo, these checks will also run automatically before every commit.
94-
95-
## Running/Adding Unit Tests
90+
## Testing
9691
9792
It is best if all new functionality and/or bug fixes have unit tests added with each use-case.
9893
@@ -102,7 +97,7 @@ We use [pytest](https://docs.pytest.org/en/latest) as our unit testing framework
10297
hatch run test
10398
```
10499
105-
## Adding/Building the Documentation
100+
## Documentation
106101
107102
If a feature is stable and relatively finalized, it is time to add it to the documentation. If you are adding any private/public functions, it is best to add docstrings, to aid in reviewing code and also for the API reference.
108103

0 commit comments

Comments
 (0)