Skip to content

Commit c8d5268

Browse files
Add pre-commit hook (HunterMcGushion#78)
* chore(): added pre-commit hook Co-authored-by: Bjorn Heesakkers <bjorn.heesakkers@sendcloud.com> Co-authored-by: Michael <code@mweiss.ch>
1 parent d4d219f commit c8d5268

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- id: docstr-coverage
2+
name: docstr-coverage
3+
entry: docstr-coverage
4+
require_serial: true
5+
language: python
6+
language_version: python3
7+
types_or: [cython, pyi, python]
8+
minimum_pre_commit_version: "2.9.0"
9+
always_run: true

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,21 @@ class FooBarChild(FooBar):
170170
pass
171171
```
172172

173+
#### Pre-commit hook
174+
175+
You can use `docstr-coverage` as a pre-commit hook by adding the following to your `.pre-commit-config.yaml` file:
176+
177+
To pass arguments to `docstr-coverage`, add a `.docstr.yaml` config (which is automatically picked up).
178+
This is preferrable over [pre-commit args](https://pre-commit.com/#config-args),
179+
as it facilitates the use of the same config in ci / pre-commit and manual runs.
180+
181+
```yaml
182+
- repo: https://github.com/HunterMcGushion/docstr_coverage
183+
rev: <most recent docstr-coverage release or commit sha>
184+
hooks:
185+
- id: docstr-coverage
186+
```
187+
173188
#### Package in Your Project
174189
175190
You can also use `docstr-coverage` as a part of your project by importing it thusly.

0 commit comments

Comments
 (0)