-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ruff to format and check code style
- Loading branch information
1 parent
a7e0404
commit 376bd88
Showing
3 changed files
with
100 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
name: "CI" | ||
name: CI | ||
|
||
on: | ||
# Run action when pushed to master, or for commits in a pull request. | ||
push: | ||
branches: | ||
- "master" | ||
tags-ignore: | ||
- "**" | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint: | ||
name: "Lint" | ||
runs-on: ubuntu-latest | ||
checks: | ||
name: Code checks | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ "3.10", "3.11", "3.12" ] | ||
steps: | ||
- name: "Checkout the repository" | ||
uses: actions/checkout@v3 | ||
- name: Check out ${{ github.sha }} from repository ${{ github.repository }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: "Check format" | ||
uses: psf/black@stable | ||
- name: Run checks | ||
run: make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
check: | ||
@poetry run ruff check | ||
|
||
codefix: | ||
@poetry run ruff format | ||
@poetry run ruff check --fix | ||
|
||
.PHONY: check codefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,73 @@ | ||
[tool.poetry] | ||
name = "home-assistant-comfoconnect" | ||
version = "0.1.0" | ||
description = "" | ||
version = "0.1.12" | ||
description = "Home Assistant Zehnder ComfoAirQ integration" | ||
authors = ["Michaël Arnauts <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "home_assistant_comfoconnect"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
python = ">=3.12,<3.13" | ||
aiocomfoconnect = "^0.1.11" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
homeassistant = "^2022.12.0" | ||
homeassistant = "^2024.06.0" | ||
ruff = "^0.5.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.ruff] | ||
extend-exclude = [ | ||
"__pycache__", | ||
"build", | ||
"dist", | ||
] | ||
target-version = "py312" | ||
line-length = 150 | ||
src = ["custom_components"] | ||
|
||
[tool.ruff.lint] | ||
extend-select = [ | ||
"C4", | ||
"D200", | ||
"D201", | ||
"D204", | ||
"D205", | ||
"D206", | ||
"D210", | ||
"D211", | ||
"D213", | ||
"D300", | ||
"D400", | ||
"D402", | ||
"D403", | ||
"D404", | ||
"D419", | ||
"E", | ||
"F", | ||
"G010", | ||
"I001", | ||
"INP001", | ||
"N805", | ||
"PERF101", | ||
"PERF102", | ||
"PERF401", | ||
"PERF402", | ||
"PGH004", | ||
"PGH005", | ||
"PIE794", | ||
"PIE796", | ||
"PIE807", | ||
"PIE810", | ||
"RET502", | ||
"RET503", | ||
"RET504", | ||
"RET505", | ||
"RUF015", | ||
"RUF100", | ||
"S101", | ||
"T20", | ||
"W", | ||
] |