mirror of
https://github.com/esphome/esphome.git
synced 2025-03-13 14:18:14 +00:00
Add ruff format check to CI
File-level granularity for python black or ruff check Ruff via requirements.txt instead of GitHub Actions
This commit is contained in:
parent
9e40d4cf45
commit
067d2005be
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@ -61,8 +61,8 @@ jobs:
|
||||
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
|
||||
pip install -e .
|
||||
|
||||
black:
|
||||
name: Check black
|
||||
py-format:
|
||||
name: Check black or ruff
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- common
|
||||
@ -74,13 +74,10 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||
- name: Run black
|
||||
- name: Run black or ruff
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
black --verbose esphome tests
|
||||
- name: Suggested changes
|
||||
run: script/ci-suggest-changes
|
||||
if: always()
|
||||
find esphome -name *.py -type f | parallel 'ruff format --check {} || black --quiet --check {}'
|
||||
|
||||
flake8:
|
||||
name: Check flake8
|
||||
@ -255,7 +252,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- common
|
||||
- black
|
||||
- py-format
|
||||
- ci-custom
|
||||
- clang-format
|
||||
- flake8
|
||||
@ -482,7 +479,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- common
|
||||
- black
|
||||
- py-format
|
||||
- ci-custom
|
||||
- clang-format
|
||||
- flake8
|
||||
|
@ -4,7 +4,7 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.5.4
|
||||
rev: v0.9.2
|
||||
hooks:
|
||||
# Run the linter.
|
||||
- id: ruff
|
||||
|
@ -1,6 +1,7 @@
|
||||
pylint==3.2.7
|
||||
flake8==7.0.0 # also change in .pre-commit-config.yaml when updating
|
||||
black==24.4.2 # also change in .pre-commit-config.yaml when updating
|
||||
ruff==0.9.2 # also change in .pre-commit-config.yaml when updating
|
||||
pyupgrade==3.15.2 # also change in .pre-commit-config.yaml when updating
|
||||
pre-commit
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user