mirror of https://github.com/astral-sh/ruff
Add pre-commit hook (#55)
This commit is contained in:
parent
5a3092e805
commit
ebfcf3edda
|
|
@ -0,0 +1,5 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/arichtman/ruff
|
||||||
|
rev: ft-pre-commit-hook
|
||||||
|
hooks:
|
||||||
|
- id: lint
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
- id: lint
|
||||||
|
name: ruff lint
|
||||||
|
description: runs a ruff lint against all Python files
|
||||||
|
entry: ruff
|
||||||
|
language: python
|
||||||
|
types_or: [python]
|
||||||
|
pass_filenames: true
|
||||||
10
README.md
10
README.md
|
|
@ -51,6 +51,16 @@ You can run ruff in `--watch` mode to automatically re-run on-change:
|
||||||
ruff path/to/code/ --watch
|
ruff path/to/code/ --watch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
ruff also works with [Pre-Commit](https://pre-commit.com) (requires Cargo on system):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/charliermarsh/ruff
|
||||||
|
rev: # See latest release
|
||||||
|
hooks:
|
||||||
|
- id: lint
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
ruff is configurable both via `pyproject.toml` and the command line.
|
ruff is configurable both via `pyproject.toml` and the command line.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue