-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Miicroo/feature/templated_attributes
Add templated attributes
- Loading branch information
Showing
11 changed files
with
318 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10-dev' | ||
- uses: pre-commit/[email protected] | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.test.txt | ||
- name: Run pytest | ||
run: | | ||
pytest |
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,2 +1,6 @@ | ||
**/.DS_Store | ||
.history | ||
.history | ||
.idea | ||
.mypy_cache | ||
__pycache__/ | ||
.coverage |
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,49 @@ | ||
repos: | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.2.2 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py310-plus] | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --safe | ||
- --quiet | ||
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$ | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.2 | ||
hooks: | ||
- id: codespell | ||
args: | ||
- --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing | ||
- --skip="./.*,*.csv,*.json" | ||
- --quiet-level=2 | ||
exclude_types: [csv, json] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-docstrings==1.5.0 | ||
- pydocstyle==5.0.2 | ||
files: ^(homeassistant|script|tests)/.+\.py$ | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
stages: [manual] | ||
- id: check-json | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.991 | ||
hooks: | ||
- id: mypy | ||
args: | ||
- --pretty | ||
- --show-error-codes | ||
- --show-error-context |
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
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 @@ | ||
""" Custom components module""" |
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
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,14 @@ | ||
# linters such as flake8 and pylint should be pinned, as new releases | ||
# make new things fail. Manually update these pins when pulling in a | ||
# new version | ||
|
||
aioresponses==0.7.2 | ||
algoliasearch==2.6.2 | ||
codecov==2.1.13 | ||
coverage>=6.4.4 | ||
mypy==0.991 | ||
pytest>=7.1.0 | ||
pytest-cov>=3.0.0 | ||
pytest-mock>=3.10 | ||
pytest-homeassistant-custom-component==0.12.20 | ||
typing-extensions>=4.6.3 |
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,61 @@ | ||
[coverage:run] | ||
source = | ||
custom_components | ||
|
||
[coverage:report] | ||
exclude_lines = | ||
pragma: no cover | ||
raise NotImplemented() | ||
if __name__ == '__main__': | ||
main() | ||
fail_under = 40 | ||
show_missing = true | ||
|
||
[tool:pytest] | ||
testpaths = tests | ||
norecursedirs = .git | ||
addopts = | ||
--strict | ||
--cov=custom_components | ||
|
||
[flake8] | ||
# https://github.com/ambv/black#line-length | ||
max-line-length = 88 | ||
# E501: line too long | ||
# W503: Line break occurred before a binary operator | ||
# E203: Whitespace before ':' | ||
# D202 No blank lines allowed after function docstring | ||
# W504 line break after binary operator | ||
ignore = | ||
E501, | ||
W503, | ||
E203, | ||
D202, | ||
W504 | ||
|
||
[isort] | ||
# https://github.com/timothycrosley/isort | ||
# https://github.com/timothycrosley/isort/wiki/isort-Settings | ||
# splits long import on multiple lines indented by 4 spaces | ||
multi_line_output = 3 | ||
include_trailing_comma=True | ||
force_grid_wrap=0 | ||
use_parentheses=True | ||
line_length=88 | ||
indent = " " | ||
# will group `import x` and `from x import` of the same module. | ||
force_sort_within_sections = true | ||
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER | ||
default_section = THIRDPARTY | ||
known_first_party = homeassistant,tests | ||
forced_separate = tests | ||
combine_as_imports = true | ||
|
||
[mypy] | ||
python_version = 3.10 | ||
ignore_errors = true | ||
follow_imports = silent | ||
ignore_missing_imports = true | ||
warn_incomplete_stub = true | ||
warn_redundant_casts = true | ||
warn_unused_configs = true |
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 @@ | ||
"""Tests for the birthdays component.""" |
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 @@ | ||
"""pytest fixtures.""" | ||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def auto_enable_custom_integrations(enable_custom_integrations): | ||
"""Enable custom integrations defined in the test dir.""" | ||
yield |
Oops, something went wrong.