From 7d492d428e526bfd1ad6aa469743dc31e2b161ad Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 24 Apr 2013 20:52:30 +0100 Subject: Check that all files have a license --- license-summary | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'license-summary') diff --git a/license-summary b/license-summary index bc2494a..22b7181 100755 --- a/license-summary +++ b/license-summary @@ -23,6 +23,7 @@ import cliapp import re +import sys __version__ = '0.0' @@ -55,6 +56,17 @@ class LicenseSummary(cliapp.Application): if without_summary: self.report_group('no summary', without_summary) + if self.settings['check']: + error = 0 + if without_summary: + sys.stderr.write( + 'ERROR: The following files have no license summary:\n') + for filename in sorted(without_summary): + sys.stderr.write(' %s\n' % filename) + error = 1 + + sys.exit(error) + def report_group(self, summary, filenames): self.output.write('%s (%d):\n' % (summary, len(filenames))) for filename in sorted(filenames): -- cgit v1.2.1