From 1f4219d765b5859342c048d6b846bac3d4faa00a Mon Sep 17 00:00:00 2001 From: Seth Wang Date: Tue, 17 May 2022 14:07:42 +0800 Subject: [PATCH 1/2] chore(missing): bump to version v0.2.5 --- README.md | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b50097..89c8ace 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The simple [pre-commit][0] hook to find the missing but necessary files. ## Example ## ```yaml - repo: https://github.com/hardcoretech/missing - rev: v0.2.4 + rev: v0.2.5 hooks: - id: missing-init-py ``` diff --git a/pyproject.toml b/pyproject.toml index 00a9668..8e93ae5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "missing" -version = "0.2.4" +version = "0.2.5" description = "" authors = ["PLM "] From 3b652dd322fcd4bed06a75a0d1f6728629aa97b6 Mon Sep 17 00:00:00 2001 From: Seth Wang Date: Tue, 17 May 2022 14:26:50 +0800 Subject: [PATCH 2/2] doc(missing): Add usage examples --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89c8ace..0ca4e6c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,53 @@ # Missing # -The simple [pre-commit][0] hook to find the missing but necessary files. + +A simple [pre-commit][0] hook to find missing `__init__.py` that is required for unit test cases to be discovered. ## Example ## + +Default setting, everything except `.git` will be scanned + +```yaml +- repo: https://github.com/hardcoretech/missing + rev: v0.2.5 + hooks: + - id: missing-init-py +``` + +Exclude according to .gitignore + +```yaml +- repo: https://github.com/hardcoretech/missing + rev: v0.2.5 + hooks: + - id: missing-init-py + args: + - --mode + - obey_gitignore +``` + +Only include git staged files + +```yaml +- repo: https://github.com/hardcoretech/missing + rev: v0.2.5 + hooks: + - id: missing-init-py + args: + - --mode + - staged_only +``` + +Exclude frontend and doc folder + ```yaml - repo: https://github.com/hardcoretech/missing rev: v0.2.5 hooks: - id: missing-init-py + args: + - --exclude + - frontend + - doc ``` [0]: https://pre-commit.com/