Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
Rename README.tests.md to CONTRIBUTING.md and add information about
running tests and pre-commit checks.
  • Loading branch information
larsks committed Sep 10, 2024
1 parent 5a60f48 commit e14de96
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 11 deletions.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing

## Pre-commit

We use [pre-commit] to run a series of [linters] on the code in this
repository. These checks will be run whenever you submit a pull request. In
order to avoid delays in getting your pull request reviewed, you will want to
enable these same checks as part of your local development workflow:

1. Install the [pre-commit] tool.
1. From the root of this repository, run:

```
pre-commit install
```

This will modify `.git/hooks/pre-commit` in your local repository to run the
pre-commit checks each time you make a commit. Among other things, these
linters will ensure consistent formatting of Python code in the repository and
alert on a variety of syntax errors.

[pre-commit]: https://pre-commit.com/
[linters]: https://en.wikipedia.org/wiki/Lint_(software)

## Unit tests

### Install prerequisites

Install the dependencies from `test-requirements.txt`:

```
pip install -r test-requirements.txt
```

### Run the tests

To run the unit tests, from the top level of the repository run:

```
pytest
```

To generate HTML coverage reports:

```
pytest --cov-report=html
```

Then open `htmlcov/index.html` in your browser.
11 changes: 0 additions & 11 deletions README.tests.md

This file was deleted.

0 comments on commit e14de96

Please sign in to comment.