mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Add isort and ruff linter
Both linters are pretty common among modern python code bases. The isort tool provides stable sorting and grouping, as well as pruning of unused imports. Ruff is a modern linter, that is very fast due to being written in rust. It can detect many common issues in a python codebase. Removes the pylint dev requirement, since ruff replaces it.
This commit is contained in:
parent
1e17dbaa91
commit
b339f53bb4
14
.github/workflows/pull_request.yml
vendored
14
.github/workflows/pull_request.yml
vendored
@ -70,11 +70,17 @@ jobs:
|
|||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
run: |
|
run: |
|
||||||
pip install pip
|
python3 -m pip install -U pip
|
||||||
pip install -r requirements-dev.txt
|
python3 -m pip install -r requirements-dev.txt
|
||||||
- name: Lint
|
- name: Check black
|
||||||
run: |
|
run: |
|
||||||
python3 -m black frigate --check
|
black --check --diff frigate migrations docker *.py
|
||||||
|
- name: Check isort
|
||||||
|
run: |
|
||||||
|
isort --check --diff frigate migrations docker *.py
|
||||||
|
- name: Check ruff
|
||||||
|
run: |
|
||||||
|
ruff check frigate migrations docker *.py
|
||||||
|
|
||||||
python_tests:
|
python_tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
5
pyproject.toml
Normal file
5
pyproject.toml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[tool.isort]
|
||||||
|
profile = "black"
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
ignore = ["E501"]
|
||||||
@ -1,2 +1,3 @@
|
|||||||
pylint == 2.17.*
|
|
||||||
black == 23.3.*
|
black == 23.3.*
|
||||||
|
isort
|
||||||
|
ruff
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user