diff options
author | gbrandl <devnull@localhost> | 2006-11-26 22:37:40 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-11-26 22:37:40 +0100 |
commit | 0ed631c5d086b5b00675d285dcb95d9cf3db9f7d (patch) | |
tree | ac6b045db4cc84da7392ffb2f32281732af3d1fe /scripts/check_sources.py | |
parent | 852b81ec842d93db6738192a1fe7bd1a39483faa (diff) | |
download | pygments-0ed631c5d086b5b00675d285dcb95d9cf3db9f7d.tar.gz |
[svn] Reformat and adapt check_sources.
Diffstat (limited to 'scripts/check_sources.py')
-rwxr-xr-x | scripts/check_sources.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/check_sources.py b/scripts/check_sources.py index 17207d94..59fd8b01 100755 --- a/scripts/check_sources.py +++ b/scripts/check_sources.py @@ -30,8 +30,10 @@ def checker(*suffixes, **kwds): name_mail_re = r'[\w ]+(<.*?>)?' -copyright_re = re.compile(r'^ :copyright: 200\d(-200\d)? by %s(, %s)*\.$' % +copyright_re = re.compile(r'^ :copyright: 200\d(-200\d)? by %s(, %s)*[,.]$' % (name_mail_re, name_mail_re)) +copyright_2_re = re.compile(r'^ %s(, %s)*[,.]$' % + (name_mail_re, name_mail_re)) coding_re = re.compile(r'coding[:=]\s*([-\w.]+)') not_ix_re = re.compile(r'\bnot\s+\S+?\s+i[sn]\s\S+') is_const_re = re.compile(r'if.*?==\s+(None|False|True)\b') @@ -127,7 +129,11 @@ def check_fileheader(fn, lines): if license != [" :license: GNU LGPL, see LICENSE for more details.\n"]: yield 0, "no correct license info" - copyright = llist[-3:-2] + ci = -3 + copyright = llist[ci:ci+1] + while copyright and copyright_2_re.match(copyright[0]): + ci -= 1 + copyright = llist[ci:ci+1] if not copyright or not copyright_re.match(copyright[0]): yield 0, "no correct copyright info" |