Skip to content

Commit

Permalink
✨ Support use of auto-optional as pre-commit hook (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
danygielow authored Oct 8, 2021
1 parent 3f904c3 commit 47f4063
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- id: auto-optional
name: auto-optional
description: Adds the Optional type-hint to arguments where the default value is None
entry: auto-optional
language: python
types: [python]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ Install with `pip install auto-optional`.
## Run
After installing you can run auto-optional using `auto-optional [path]` (path is an optional argument).

## pre-commit

You can run auto-optional via [pre-commit](https://pre-commit.com/).
Add the following text to your repositories `.pre-commit-config.yaml`:

```yaml
repos:
- repo: https://github.com/luttik/auto-optional
rev: v0.2.0 # The version of auto-optional to use
hooks:
- id: auto-optional
```
## Things of note
### Things that are handled well
Expand Down
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ Install with `pip install auto-optional`.
## Run
After installing you can run auto-optional using `auto-optional [path]` (path is an optional argument).

## pre-commit

You can run auto-optional via [pre-commit](https://pre-commit.com/).
Add the following text to your repositories `.pre-commit-config.yaml`:

```yaml
repos:
- repo: https://github.com/luttik/auto-optional
rev: v0.2.0 # The version of auto-optional to use
hooks:
- id: auto-optional
```
## Things of note
### Things that are handled well
Expand Down

0 comments on commit 47f4063

Please sign in to comment.