diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-04-24 20:52:30 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-04-24 20:52:30 +0100 |
commit | 7d492d428e526bfd1ad6aa469743dc31e2b161ad (patch) | |
tree | d52f3044a0928775d629641cae54a3b55f0780b0 | |
parent | c1df493901693db36f6e89472df18737a23fdc61 (diff) | |
download | license-summary-7d492d428e526bfd1ad6aa469743dc31e2b161ad.tar.gz |
Check that all files have a license
-rwxr-xr-x | license-summary | 12 |
1 files changed, 12 insertions, 0 deletions
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): |