Skip to content

Commit 6ec2ed8

Browse files
committed
add code style docs
1 parent b06698b commit 6ec2ed8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/source/testing.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,23 @@ Sphinx Application API is available as a parameter to all the test functions:
2929
@pytest.mark.sphinx('html', testroot="mybook")
3030
def mytest(app):
3131
```
32+
33+
## Code Style
34+
35+
Code is formatted using [black](https://github.com/ambv/black) and code style is tested using [flake8](http://flake8.pycqa.org) with style configuration set in `.flake8`.
36+
37+
Installing using `[code style]` will make the [pre-commit](https://pre-commit.com/) package available which will make sure the style is met before your commits are submitted. In addition, it will reformat for any lint errors.
38+
39+
To install `pre-commit` run the following
40+
41+
```bash
42+
cd sphinxcontrib-prettyproof
43+
pre-commit install
44+
```
45+
46+
`black` and `flake8` can be run separately:
47+
48+
```shell
49+
>>> black .
50+
>>> flake8 .
51+
```

0 commit comments

Comments
 (0)