Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install flake8
run: pip install flake8
- name: Run flake8
uses: suo/flake8-github-action@releases/v1
with:
checkName: 'flake8_py3'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install poetry
poetry install
- name: Run Linters
run: |
black homeassistant_api --check
isort homeassistant_api --check-only
mypy homeasistant_api --show-error-codes
pylint homeasistant_api
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tasks:
- init: |
pip install poetry
poetry config virtualenvs.create false
poetry install
vscode:
extensions:
- ms-python.python
- matangover.mypy
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
hooks:
- id: mypy
rev: 'v0.931'
- repo: https://github.com/pre-commit/pre-commit-hooks
hooks:
- id: trailing-whitespace
rev: 'v4.1.0'
- repo: https://github.com/psf/black
hooks:
- id: black
rev: '21.12b0'
- repo: https://github.com/PyCQA/isort
rev: '5.10.1'
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint
rev: 'v2.12.2'
hooks:
- id: pylint
176 changes: 171 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ python = "^3.7"
requests = "^2.26.0"
simplejson = "^3.17.6"
aiohttp = {version = "^3.8.1", extras = ["async"]}
pre-commit = "^2.17.0"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
Expand All @@ -29,6 +30,11 @@ pytest = "^6.2.5"
[tool.isort]
profile = "black"

[tool.pylint.messages_control]
disable = [
"invalid-name"
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"