lint-all: Require newlines at end of JSON files.

This commit is contained in:
Tim Abbott 2016-04-14 10:48:30 -07:00
parent 5195d1ecb7
commit e71d8bb4b6
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,7 @@ puppet/puppet-common/tests/
""".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'], group_by_ftype=True, exclude=exclude) ftypes=['py', 'sh', 'js', 'pp', 'css', 'handlebars', 'html', 'json'], 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.
@ -153,6 +153,7 @@ css_rules = [
] + whitespace_rules ] + whitespace_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
def check_custom_checks(): def check_custom_checks():
failed = False failed = False
@ -181,6 +182,10 @@ def check_custom_checks():
if custom_check_file(fn, html_rules): if custom_check_file(fn, html_rules):
failed = True failed = True
for fn in by_lang['json']:
if custom_check_file(fn, json_rules):
failed = True
return failed return failed
lint_functions = {} lint_functions = {}