Lint indentation rules
Your task
Lint the indentation of a nested CI file. Rules: (a) leading indentation consists of spaces, if the first character after the leading spaces is a tab, the line is bad; (b) the space count must be even (level = spaces/2); (c) the first non-blank line must be at level 0; (d) compared with the previous non-blank line, a line may go deeper by at most ONE level, while any decrease is fine; (e) whitespace-only lines are invisible to all rules. Return true when every line passes, false at the first violation. An empty file is valid.
Examples
validate_indentation(lines: list[str]) -> boolExample 1
Input
validate_indentation(["deploy:", " region: us-east", " "])Output
TrueExample 2
Input
validate_indentation(["jobs:", " build: go"])Output
False