mirror of
https://github.com/deepseek-ai/DeepInfer.git
synced 2026-11-09 22:59:44 +08:00
Add pre-commit hooks for Ruff formatting and linting
Signed-off-by: Tony Lin <tony.lin@intel.com>
This commit is contained in:
parent
774ce244b8
commit
3a8d5865dd
7
.pre-commit-config.yaml
Normal file
7
.pre-commit-config.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.15.0
|
||||||
|
hooks:
|
||||||
|
- id: ruff-check
|
||||||
|
args: [--fix]
|
||||||
|
- id: ruff-format
|
||||||
@ -6,6 +6,18 @@ Run all commands below from the repository root. See [README.md](README.md) for
|
|||||||
|
|
||||||
Before committing, format the modified code and pass the corresponding checks.
|
Before committing, format the modified code and pass the corresponding checks.
|
||||||
|
|
||||||
|
### Pre-commit
|
||||||
|
|
||||||
|
Install [pre-commit](https://pre-commit.com/) and enable the Git hook in your local clone:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python -m pip install pre-commit
|
||||||
|
pre-commit install
|
||||||
|
pre-commit run --all-files # Optional: check the whole repository
|
||||||
|
```
|
||||||
|
|
||||||
|
The hook runs Ruff checks and formatting on staged Python files. If it changes a file, review and stage the changes before committing again. Each contributor must install the hook in their own clone.
|
||||||
|
|
||||||
### Python
|
### Python
|
||||||
|
|
||||||
Ruff is configured in [pyproject.toml](pyproject.toml).
|
Ruff is configured in [pyproject.toml](pyproject.toml).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user