Skip to content

Commit

Permalink
Adding configuration for pre-commit (#190)
Browse files Browse the repository at this point in the history
* Adding configuration for pre-commit

* Adding a note about usage as pre-commit hook

* Correcting PySpelling and putting pre-commit into an inline codeblock

* Correcting pass_filenames

* Correcting a small typo

* Fixing one more typo

* Fixing markdown section
  • Loading branch information
sscheib authored Mar 20, 2024
1 parent 96746b8 commit 63e4654
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- id: 'pyspelling'
name: 'pyspelling'
description: 'This hook runs pyspelling'
language: 'python'
entry: 'pyspelling'
pass_filenames: false
additional_dependencies:
- 'pymdown-extensions'
...
20 changes: 20 additions & 0 deletions docs/src/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,23 @@ 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 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
---
repos:
- repo: 'https://github.com/facelessuser/pyspelling.git'
rev: 'v2.11'
hooks:
- id: 'pyspelling'
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.

0 comments on commit 63e4654

Please sign in to comment.