Skip to content

Commit

Permalink
css linter: Fix error reporting.
Browse files Browse the repository at this point in the history
Three changes:
    * Change wording of error message.
    * Flush standard error.
    * Use unified diff.
  • Loading branch information
Steve Howell committed Jan 3, 2018
1 parent f620525 commit a49fd44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/check-css
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ def validate(fn):
text = open(fn).read()
section_list = parse(text)
if text != section_list.text():
print('%s seems to be broken:' % (fn,))
sys.stderr.write('''
FAIL: {} is being rejected by our finicky linter)
(you can manually apply the diff to fix)\n\n'''.format(fn,))
sys.stderr.flush()

open('/var/tmp/pretty_css.txt', 'w').write(section_list.text())
subprocess.call(['diff', fn, '/var/tmp/pretty_css.txt'], stderr=subprocess.STDOUT)
subprocess.call(['diff', '-u', fn, '/var/tmp/pretty_css.txt'], stderr=subprocess.STDOUT)
sys.exit(1)

def check_our_files(filenames):
Expand Down

0 comments on commit a49fd44

Please sign in to comment.