Extract check_our_files in check-templates.

(imported from commit 68049b19aacfb159a92e7142b9975a5376c0f9f5)
This commit is contained in:
Steve Howell
2014-02-27 10:41:47 -05:00
committed by Jessica McKellar
parent c9140a6def
commit c7a9e08105

View File

@@ -88,6 +88,7 @@ def validate(fn, check_indent=True):
if state.depth != 0: if state.depth != 0:
return state.matcher("(NO TAG)") return state.matcher("(NO TAG)")
def check_our_files():
git_files = map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n')) git_files = map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n'))
# Check all our handlebars templates. # Check all our handlebars templates.
@@ -110,3 +111,6 @@ templates = filter(ok, templates)
assert len(templates) >= 10 # sanity check that we are actually doing work assert len(templates) >= 10 # sanity check that we are actually doing work
for fn in templates: for fn in templates:
validate(fn, check_indent=False) validate(fn, check_indent=False)
if __name__ == '__main__':
check_our_files()