From 64fa1ca7da69a66bd3c1a30c883654272fc78de7 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Apr 2014 18:47:01 +0100 Subject: Add test for simple copyright statement --- copyright-statement-lint | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'copyright-statement-lint') diff --git a/copyright-statement-lint b/copyright-statement-lint index db61ded..5ca8033 100755 --- a/copyright-statement-lint +++ b/copyright-statement-lint @@ -32,6 +32,12 @@ copyright_pattern = re.compile( class CopyrightStatementLint(cliapp.Application): + def add_settings(self): + self.settings.integer( + ['debug-commit-year'], + 'pretend the commit is from YEAR', + metavar='YEAR') + def setup(self): self.errors = False @@ -61,6 +67,9 @@ class CopyrightStatementLint(cliapp.Application): self.statements.append(m) def get_commit_year(self, filename): + if self.settings['debug-commit-year']: + return self.settings['debug-commit-year'] + output = cliapp.runcmd(['git', 'log', '-n1', filename]) for line in output.splitlines(): -- cgit v1.2.1