lint: Check whitespace rules in markdown files too.

This commit is contained in:
Tim Abbott 2016-04-14 14:29:58 -07:00
parent 1a162ecb97
commit 39950b8f4f
1 changed files with 8 additions and 1 deletions

View File

@ -43,10 +43,12 @@ api/setup.py
api/integrations/perforce/git_p4.py api/integrations/perforce/git_p4.py
puppet/apt/.forge-release puppet/apt/.forge-release
puppet/puppet-common/tests/ puppet/puppet-common/tests/
puppet/apt/README.md
""".split() """.split()
by_lang = lister.list_files(args, modified_only=options.modified, use_shebang=True, by_lang = lister.list_files(args, modified_only=options.modified, use_shebang=True,
ftypes=['py', 'sh', 'js', 'pp', 'css', 'handlebars', 'html', 'json'], group_by_ftype=True, exclude=exclude) ftypes=['py', 'sh', 'js', 'pp', 'css', 'handlebars', 'html', 'json', 'md'],
group_by_ftype=True, exclude=exclude)
# Invoke the appropriate lint checker for each language, # Invoke the appropriate lint checker for each language,
# and also check files for extra whitespace. # and also check files for extra whitespace.
@ -154,6 +156,7 @@ css_rules = [
handlebars_rules = whitespace_rules handlebars_rules = whitespace_rules
html_rules = whitespace_rules html_rules = whitespace_rules
json_rules = [] # just fix newlines at ends of files json_rules = [] # just fix newlines at ends of files
markdown_rules = whitespace_rules
def check_custom_checks(): def check_custom_checks():
failed = False failed = False
@ -186,6 +189,10 @@ def check_custom_checks():
if custom_check_file(fn, json_rules): if custom_check_file(fn, json_rules):
failed = True failed = True
for fn in by_lang['md']:
if custom_check_file(fn, markdown_rules):
failed = True
return failed return failed
lint_functions = {} lint_functions = {}