From e71d8bb4b6b1e90f4b6c0fb9ab93cd9929c9d87e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 14 Apr 2016 10:48:30 -0700 Subject: [PATCH] lint-all: Require newlines at end of JSON files. --- tools/lint-all | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/lint-all b/tools/lint-all index d9c583f1e2..a66d129ca7 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -46,7 +46,7 @@ puppet/puppet-common/tests/ """.split() 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, # and also check files for extra whitespace. @@ -153,6 +153,7 @@ css_rules = [ ] + whitespace_rules handlebars_rules = whitespace_rules html_rules = whitespace_rules +json_rules = [] # just fix newlines at ends of files def check_custom_checks(): failed = False @@ -181,6 +182,10 @@ def check_custom_checks(): if custom_check_file(fn, html_rules): failed = True + for fn in by_lang['json']: + if custom_check_file(fn, json_rules): + failed = True + return failed lint_functions = {}