From 72fefa8c310c3e1c98e51980177d163dd2010c2d Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 13:26:53 +0100 Subject: [PATCH 1/7] Adding configuration for pre-commit --- .pre-commit-hooks.yaml | 10 ++++++++++ 1 file changed, 10 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..3cd2487 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,10 @@ +--- +- id: 'pyspelling' + name: 'pyspelling' + description: 'This hook runs pyspelling' + language: 'python' + entry: 'pyspelling' + pass_filenames: false + additional_dependencies: + - 'pymdown-extensions' +... From 4131db2438f9b7c3ce5b64e670437f3836108764 Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 21:22:25 +0100 Subject: [PATCH 2/7] Adding a note about usage as pre-commit hook --- docs/src/markdown/index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index 4dbc17c..4cd58c5 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -309,3 +309,21 @@ jobs: In *this* project, we actually use `tox` to make running our tests locally and in CI easier. If you would like to use `tox` as well, you can check out how this project does it by taking a look at the source. + +## Usage as pre-commit Hook + +`pyspelling` can be used as [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a +look at the following example `.pre-commit-config.yaml`: + +```yaml +repos: + - repo: 'https://github.com/facelessuser/pyspelling.git' + rev: 'v2.11' + hooks: + - id: 'pyspelling' + verbose: true + pass_filenames: true +... + +Please note that version tags should be preferred over using the `master` branch as revision (`rev`) attribute, as the +`master` branch is considered unstable. From ccdef6ced50a2c44782340456a86952b9a6bcd9d Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 21:34:41 +0100 Subject: [PATCH 3/7] Correcting PySpelling and putting pre-commit into an inline codeblock --- docs/src/markdown/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index 4cd58c5..5df3ec2 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -310,9 +310,9 @@ jobs: In *this* project, we actually use `tox` to make running our tests locally and in CI easier. If you would like to use `tox` as well, you can check out how this project does it by taking a look at the source. -## Usage as pre-commit Hook +## Usage as `pre-commit` Hook -`pyspelling` can be used as [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a +PySpelling can be used as [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a look at the following example `.pre-commit-config.yaml`: ```yaml From 3286447e1f4ad82a51008d491740ab87e173f989 Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 21:49:52 +0100 Subject: [PATCH 4/7] Correcting pass_filenames --- docs/src/markdown/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index 5df3ec2..574cc8f 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -322,7 +322,7 @@ repos: hooks: - id: 'pyspelling' verbose: true - pass_filenames: true + pass_filenames: false ... Please note that version tags should be preferred over using the `master` branch as revision (`rev`) attribute, as the From 1194f1696c5005dec318dc92f90d79a78d270a43 Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 21:53:46 +0100 Subject: [PATCH 5/7] Correcting a small typo --- docs/src/markdown/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index 574cc8f..fc44c98 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -312,7 +312,7 @@ In *this* project, we actually use `tox` to make running our tests locally and i ## Usage as `pre-commit` Hook -PySpelling can be used as [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a +PySpelling can be used as a [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a look at the following example `.pre-commit-config.yaml`: ```yaml From e450392094a4d2cf5fac25db4ddf965df2405646 Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 22:14:52 +0100 Subject: [PATCH 6/7] Fixing one more typo --- docs/src/markdown/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index fc44c98..a5f0f7e 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -312,7 +312,7 @@ In *this* project, we actually use `tox` to make running our tests locally and i ## Usage as `pre-commit` Hook -PySpelling can be used as a [`pre-commit`](https://pre-commit.com/) hook. To use it as `pre-commit` hook, please have a +PySpelling can be used as a [`pre-commit`](https://pre-commit.com/) hook. To use it as a `pre-commit` hook, please have a look at the following example `.pre-commit-config.yaml`: ```yaml From ce48733e6169e808c62e41fb63dbca73181bc2e6 Mon Sep 17 00:00:00 2001 From: Steffen Scheib Date: Wed, 20 Mar 2024 23:44:26 +0100 Subject: [PATCH 7/7] Fixing markdown section --- docs/src/markdown/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index a5f0f7e..10bc98f 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -316,6 +316,7 @@ PySpelling can be used as a [`pre-commit`](https://pre-commit.com/) hook. To use look at the following example `.pre-commit-config.yaml`: ```yaml +--- repos: - repo: 'https://github.com/facelessuser/pyspelling.git' rev: 'v2.11' @@ -324,6 +325,7 @@ repos: verbose: true pass_filenames: false ... +``` Please note that version tags should be preferred over using the `master` branch as revision (`rev`) attribute, as the `master` branch is considered unstable.