diff options
author | Georg Brandl <georg@python.org> | 2008-07-18 22:55:36 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-07-18 22:55:36 +0000 |
commit | ae2570c2690d7332f843f0e00ec0e8e2ba816bd7 (patch) | |
tree | 1dc24530c825039c6e2c0cfe649847b274241a56 /utils/check_sources.py | |
parent | 7cf390aa9b7cfa39ccfdd30d907256bb996dd757 (diff) | |
download | sphinx-git-ae2570c2690d7332f843f0e00ec0e8e2ba816bd7.tar.gz |
Merged revisions 64808,65013,65076,65100-65101,65119,65121-65123 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r64808 | georg.brandl | 2008-07-08 21:39:33 +0200 (Tue, 08 Jul 2008) | 2 lines
Allow relocation of source and doctree dir.
........
r65013 | georg.brandl | 2008-07-16 15:25:30 +0200 (Wed, 16 Jul 2008) | 2 lines
Remove curious quote.
........
r65076 | georg.brandl | 2008-07-17 22:43:01 +0200 (Thu, 17 Jul 2008) | 2 lines
Add a test for sphinx.quickstart.
........
r65100 | georg.brandl | 2008-07-18 14:41:54 +0200 (Fri, 18 Jul 2008) | 2 lines
Fix phony targets.
........
r65101 | georg.brandl | 2008-07-18 14:55:03 +0200 (Fri, 18 Jul 2008) | 2 lines
Fix problems in "make check".
........
r65119 | georg.brandl | 2008-07-18 23:06:42 +0200 (Fri, 18 Jul 2008) | 2 lines
Emit a more precise error message in autodoc.
........
r65121 | georg.brandl | 2008-07-18 23:41:35 +0200 (Fri, 18 Jul 2008) | 2 lines
Warn if a toctree-included document doesn't contain a title.
........
r65122 | georg.brandl | 2008-07-18 23:51:28 +0200 (Fri, 18 Jul 2008) | 2 lines
Don't use \samp{} for code with whitespaces, only for :samp:`code`.
........
r65123 | georg.brandl | 2008-07-19 00:49:46 +0200 (Sat, 19 Jul 2008) | 2 lines
Put inheritance info always on its own line.
........
Diffstat (limited to 'utils/check_sources.py')
-rwxr-xr-x | utils/check_sources.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/check_sources.py b/utils/check_sources.py index 525256076..0f834fcab 100755 --- a/utils/check_sources.py +++ b/utils/check_sources.py @@ -7,7 +7,7 @@ Make sure each Python file has a correct file header including copyright and license information. - :copyright: 2006-2007 by Georg Brandl. + :copyright: 2006-2008 by Georg Brandl. :license: GNU GPL, see LICENSE for more details. """ @@ -57,15 +57,17 @@ def check_style_and_encoding(fn, lines): for lno, line in enumerate(lines): if len(line) > 90: yield lno+1, "line too long" + if lno < 2: + co = coding_re.search(line) + if co: + encoding = co.group(1) + if line.strip().startswith('#'): + continue m = not_ix_re.search(line) if m: yield lno+1, '"' + m.group() + '"' if is_const_re.search(line): yield lno+1, 'using == None/True/False' - if lno < 2: - co = coding_re.search(line) - if co: - encoding = co.group(1) try: line.decode(encoding) except UnicodeDecodeError, err: |