Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a pre-commit hook config file #244

Merged
merged 12 commits into from
Jan 16, 2021
9 changes: 9 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- id: vulture
name: vulture
language: python
entry: vulture
description: Find unused Python code.
types: [python]
pass_filenames: false
require_serial: true

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# unreleased

* Add [pre-commit](https://pre-commit.com) hook (Clément Robert #244).

# 2.2 (2021-01-15)

* Only parse format strings when being used with `locals()` (jingw, #225).
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ tool for higher code quality.

$ pip install vulture

### Version control integration

After installing [pre-commit](https://pre-commit.com/#install), add the
following to the `.pre-commit-config.yaml` file in your repository:

```yaml
repos:
- repo: https://github.com/jendrikseipp/vulture
rev: 2.3
hooks:
- id: vulture
```

Then run `pre-commit install`. In order to run Vulture before each commit, you will also
need to specify all files that should be checked in the `pyproject.toml` file under the
`paths` key.
jendrikseipp marked this conversation as resolved.
Show resolved Hide resolved

## Usage

$ vulture myscript.py # or
Expand Down