From 47f4063aeeab84d093793b1e95ad1eb3156f4d3e Mon Sep 17 00:00:00 2001 From: Dany Gielow Date: Fri, 8 Oct 2021 16:38:48 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Support=20use=20of=20auto-optional?= =?UTF-8?q?=20as=20pre-commit=20hook=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-hooks.yaml | 6 ++++++ README.md | 13 +++++++++++++ docs/index.md | 13 +++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..92aeddc --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -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] diff --git a/README.md b/README.md index 5602369..43ceb8e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/index.md b/docs/index.md index f34765a..6e94ea9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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