generated from astrandb/hass_cc_template
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #11 from astrandb/NewDevContainer
New dev container
- Loading branch information
Showing
20 changed files
with
304 additions
and
126 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,55 @@ | ||
{ | ||
"name": "astrandb/dev-viva", | ||
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye", | ||
"postCreateCommand": "scripts/setup", | ||
"appPort": ["9124:8123"], | ||
"portsAttributes": { | ||
"8123": { | ||
"label": "Home Assistant internal", | ||
"onAutoForward": "notify" | ||
}, | ||
"9124": { | ||
"label": "Home Assistant remote", | ||
"onAutoForward": "notify" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"github.vscode-pull-request-github", | ||
"ryanluker.vscode-coverage-gutters", | ||
"ms-python.vscode-pylance", | ||
"ms-python.pylint", | ||
"ms-python.black-formatter", | ||
"thibault-vanderseypen.i18n-json-editor" | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.tabSize": 4, | ||
"python.pythonPath": "/usr/bin/python3", | ||
"python.analysis.autoSearchPaths": false, | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnSave": true | ||
}, | ||
"python.formatting.provider": "none", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true, | ||
"[markdown]": { | ||
"files.trimTrailingWhitespace": false | ||
}, | ||
"i18nJsonEditor.forceKeyUPPERCASE": false, | ||
"i18nJsonEditor.supportedFolders": ["translations", "i18n"] | ||
} | ||
} | ||
}, | ||
"remoteUser": "vscode", | ||
"features": { | ||
"ghcr.io/devcontainers/features/rust:1": {} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
|
||
- package-ecosystem: 'pip' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
ignore: | ||
# Dependabot should not update Home Assistant as that should match the homeassistant key in hacs.json | ||
- dependency-name: 'homeassistant' |
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 |
---|---|---|
@@ -1,30 +1,34 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
exclude: (.vscode|.devcontainer) | ||
- id: pretty-format-json | ||
args: ["--autofix", "--no-ensure-ascii", "--top-keys=domain,name"] | ||
files: manifest.json | ||
- id: pretty-format-json | ||
args: ["--autofix", "--no-ensure-ascii", "--top-keys=name"] | ||
files: hacs.json | ||
- id: pretty-format-json | ||
args: ["--autofix", "--no-ensure-ascii", "--no-sort-keys"] | ||
files: (/strings\.json$|translations/.+\.json$) | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --quiet | ||
files: ^((custom_components|homeassistant|pylint|script|tests)/.+)?[^/]+\.py$ | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.278 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --quiet | ||
files: ^((custom_components|homeassistant|pylint|script|tests)/.+)?[^/]+\.py$ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
exclude: (.vscode|.devcontainer) | ||
- id: pretty-format-json | ||
args: ['--autofix', '--no-ensure-ascii', '--top-keys=domain,name'] | ||
files: manifest.json | ||
- id: pretty-format-json | ||
args: ['--autofix', '--no-ensure-ascii', '--top-keys=name'] | ||
files: hacs.json | ||
- id: pretty-format-json | ||
args: ['--autofix', '--no-ensure-ascii', '--no-sort-keys'] | ||
files: (/strings\.json$|translations/.+\.json$) | ||
- id: check-yaml | ||
args: ['--unsafe'] | ||
- id: check-added-large-files | ||
- id: check-shebang-scripts-are-executable |
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,100 @@ | ||
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml | ||
|
||
target-version = "py310" | ||
|
||
select = [ | ||
"B002", # Python does not support the unary prefix increment | ||
"B007", # Loop control variable {name} not used within loop body | ||
"B014", # Exception handler with duplicate exception | ||
"B023", # Function definition does not bind loop variable {name} | ||
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged | ||
"C", # complexity | ||
"COM818", # Trailing comma on bare tuple prohibited | ||
"D", # docstrings | ||
"E", # pycodestyle | ||
"F", # pyflakes/autoflake | ||
"G", # flake8-logging-format | ||
"I", # isort | ||
"ICN001", # import concentions; {name} should be imported as {asname} | ||
"ISC001", # Implicitly concatenated string literals on one line | ||
"N804", # First argument of a class method should be named cls | ||
"N805", # First argument of a method should be named self | ||
"N815", # Variable {name} in class scope should not be mixedCase | ||
"PGH001", # No builtin eval() allowed | ||
"PGH004", # Use specific rule codes when using noqa | ||
"PLC0414", # Useless import alias. Import alias does not rename original package. | ||
"PLC", # pylint | ||
"PLE", # pylint | ||
"PLR", # pylint | ||
"PLW", # pylint | ||
"Q000", # Double quotes found but single quotes preferred | ||
"RUF006", # Store a reference to the return value of asyncio.create_task | ||
"S102", # Use of exec detected | ||
"S103", # bad-file-permissions | ||
"S108", # hardcoded-temp-file | ||
"S306", # suspicious-mktemp-usage | ||
"S307", # suspicious-eval-usage | ||
"S313", # suspicious-xmlc-element-tree-usage | ||
"S314", # suspicious-xml-element-tree-usage | ||
"S315", # suspicious-xml-expat-reader-usage | ||
"S316", # suspicious-xml-expat-builder-usage | ||
"S317", # suspicious-xml-sax-usage | ||
"S318", # suspicious-xml-mini-dom-usage | ||
"S319", # suspicious-xml-pull-dom-usage | ||
"S320", # suspicious-xmle-tree-usage | ||
"S601", # paramiko-call | ||
"S602", # subprocess-popen-with-shell-equals-true | ||
"S604", # call-with-shell-equals-true | ||
"S608", # hardcoded-sql-expression | ||
"S609", # unix-command-wildcard-injection | ||
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass | ||
"SIM117", # Merge with-statements that use the same scope | ||
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys() | ||
"SIM201", # Use {left} != {right} instead of not {left} == {right} | ||
"SIM208", # Use {expr} instead of not (not {expr}) | ||
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a} | ||
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'. | ||
"SIM401", # Use get from dict with default instead of an if block | ||
"T100", # Trace found: {name} used | ||
"T20", # flake8-print | ||
"TRY004", # Prefer TypeError exception for invalid type | ||
"TRY200", # Use raise from to specify exception cause | ||
"TRY302", # Remove exception handler; error is immediately re-raised | ||
"UP", # pyupgrade | ||
"W", # pycodestyle | ||
] | ||
|
||
ignore = [ | ||
"D202", # No blank lines allowed after function docstring | ||
"D203", # 1 blank line required before class docstring | ||
"D213", # Multi-line docstring summary should start at the second line | ||
"D406", # Section name should end with a newline | ||
"D407", # Section name underlining | ||
"E501", # line too long | ||
"E731", # do not assign a lambda expression, use a def | ||
"PLC1901", # Lots of false positives | ||
# False positives https://github.com/astral-sh/ruff/issues/5386 | ||
"PLC0208", # Use a sequence type instead of a `set` when iterating over values | ||
"PLR0911", # Too many return statements ({returns} > {max_returns}) | ||
"PLR0912", # Too many branches ({branches} > {max_branches}) | ||
"PLR0913", # Too many arguments to function call ({c_args} > {max_args}) | ||
"PLR0915", # Too many statements ({statements} > {max_statements}) | ||
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable | ||
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target | ||
"UP006", # keep type annotation style as is | ||
"UP007", # keep type annotation style as is | ||
# Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923 | ||
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` | ||
|
||
] | ||
|
||
[isort] | ||
force-sort-within-sections = true | ||
known-first-party = ["homeassistant"] | ||
combine-as-imports = true | ||
|
||
[flake8-pytest-style] | ||
fixture-parentheses = false | ||
|
||
[mccabe] | ||
max-complexity = 25 |
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,8 +0,0 @@ | ||
{ | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"files.associations": { | ||
"*.yaml": "home-assistant" | ||
} | ||
} | ||
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
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,16 @@ | ||
|
||
# Loads default set of integrations. Do not remove. | ||
default_config: | ||
|
||
# Load frontend themes from the themes folder | ||
frontend: | ||
themes: !include_dir_merge_named themes | ||
|
||
automation: !include automations.yaml | ||
script: !include scripts.yaml | ||
scene: !include scenes.yaml | ||
|
||
logger: | ||
default: info | ||
logs: | ||
homeassistant.components.viva: debug |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.