Skip to content

Commit

Permalink
Add note about remote package secrets (and fix lint.py) (esphome#1943)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Feb 27, 2022
1 parent 4cf5787 commit 5b89b2a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions guides/configuration-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 14 additions & 4 deletions lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/",
Expand Down

0 comments on commit 5b89b2a

Please sign in to comment.