tools: Document indentation policy.

This commit is contained in:
Tim Abbott 2021-12-06 15:00:54 -08:00
parent 1509e7f355
commit f8e35b5b36
1 changed files with 6 additions and 1 deletions

View File

@ -27,7 +27,12 @@ def shift_indents_to_the_next_tokens(tokens: List[Token]) -> None:
def token_allows_children_to_skip_indents(token: Token) -> bool: def token_allows_children_to_skip_indents(token: Token) -> bool:
# For legacy reasons we don't always indent blocks. # To avoid excessive indentation in templates with other
# conditionals, we don't require extra indentation for template
# logic blocks don't contain further logic as direct children.
# Each blocks are excluded from this rule, since we want loops to
# stand out.
if token.tag == "each": if token.tag == "each":
return False return False