precommit

This commit is contained in:
Raykov-MS 2026-06-04 16:45:18 +03:00
parent 1657fdf67d
commit 998354293b
4 changed files with 31 additions and 1 deletions

16
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,16 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

View File

@ -51,3 +51,15 @@ streamlit run main.py
ruff check . ruff check .
ruff format . ruff format .
``` ```
## Pre-commit
```bash
pre-commit install
pre-commit run --all-files
```
Используются хуки:
- `black`
- `isort`
- `ruff` и `ruff-format`

View File

@ -2,7 +2,6 @@ from __future__ import annotations
from typing import Any, Protocol from typing import Any, Protocol
from app.config import get_location
from .mock_provider import get_jwt_token as get_jwt_token_local from .mock_provider import get_jwt_token as get_jwt_token_local
from .mock_provider import protect_application as protect_application_local from .mock_provider import protect_application as protect_application_local

View File

@ -2,3 +2,6 @@ streamlit==1.46.1
raisa-streamlit-oauth==1.0.3 raisa-streamlit-oauth==1.0.3
python-dotenv==1.0.1 python-dotenv==1.0.1
ruff==0.5.2 ruff==0.5.2
black==24.4.2
isort==5.13.2
pre-commit==3.7.1