Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tools: Document indentation policy.

Tim Abbottf8e35b5b36ea
diff --git a/tools/lib/pretty_print.py b/tools/lib/pretty_print.py
index cfef194df5d..daa564d43ab 100644
--- a/tools/lib/pretty_print.py
+++ b/tools/lib/pretty_print.py
@@ -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:
- # 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":
return False