From 31075afed9f8fa008a3ed2a9ff0d7ed024ff8564 Mon Sep 17 00:00:00 2001 From: "georg.brandl" Date: Fri, 18 Jul 2008 22:55:36 +0000 Subject: 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. ........ --- utils/check_sources.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'utils') diff --git a/utils/check_sources.py b/utils/check_sources.py index 52525607..0f834fca 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: -- cgit v1.2.1