Add note about remote package secrets (and fix lint.py) (#1943)

This commit is contained in:
Jesse Hills 2022-02-27 22:58:51 +13:00 committed by GitHub
parent 4cf5787e11
commit 5b89b2a0f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -361,6 +361,11 @@ Packages can also be loaded from a git repository by utilizing the correct confi
:ref:`config-substitutions` can be used inside the remote packages which allows users to override
them locally with their own subsitution value.
.. note::
Remote packages cannot have ``secret`` lookups in them. They should instead make use of substitutions with an
optional default in the packaged YAML, which the local device YAML can set using values from the local secrets.
.. code-block:: yaml
packages:

18
lint.py
View File

@ -356,8 +356,12 @@ def lint_directive_formatting(fname, content):
# Empty line must follow
if lines[j]:
errors.append(
"Directive '{}' is not followed by an empty line. Please insert an "
"empty line after {}:{}".format(directive_name, f, j)
(
j,
1,
"Directive '{}' is not followed by an empty line. Please insert an "
"empty line after {}:{}".format(directive_name, fname, j),
)
)
continue
@ -374,11 +378,17 @@ def lint_directive_formatting(fname, content):
num_indent = num_spaces - base_indentation
if j == k and num_indent != 4:
errors.append(
"Directive '{}' must be indented with 4 spaces, not {}. See "
"{}:{}".format(directive_name, num_indent, f, j + 1)
(
j + 1,
num_indent,
"Directive '{}' must be indented with 4 spaces, not {}. See "
"{}:{}".format(directive_name, num_indent, fname, j + 1),
)
)
break
return errors
@lint_re_check(
r"https://esphome.io/",