From 5b89b2a0f2cd565aaf027ea0173a42fba1f354f9 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Sun, 27 Feb 2022 22:58:51 +1300 Subject: [PATCH] Add note about remote package secrets (and fix lint.py) (#1943) --- guides/configuration-types.rst | 5 +++++ lint.py | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/guides/configuration-types.rst b/guides/configuration-types.rst index 4fa5806fa..1604a1353 100644 --- a/guides/configuration-types.rst +++ b/guides/configuration-types.rst @@ -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: diff --git a/lint.py b/lint.py index ed2e4110c..a4b3276a1 100644 --- a/lint.py +++ b/lint.py @@ -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/",