diff options
| author | Georg Brandl <georg@python.org> | 2009-03-09 14:25:52 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2009-03-09 14:25:52 +0100 |
| commit | 1b8ec091df3a00e2c69ec24353df41d3b4a0d402 (patch) | |
| tree | e33ddf5cf7adaddbe072f1c4530a8c901a68d4fc /utils | |
| parent | 81b5d1925d6747d3262de1a404571308b2c8889b (diff) | |
| parent | 22fb71059ba1fd72c6eee0a9a2038c2bc34929bd (diff) | |
| download | sphinx-1b8ec091df3a00e2c69ec24353df41d3b4a0d402.tar.gz | |
merge with 0.5
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/check_sources.py | 14 | ||||
| -rwxr-xr-x | utils/reindent.py | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/utils/check_sources.py b/utils/check_sources.py index ad808883..7fe0cbb7 100755 --- a/utils/check_sources.py +++ b/utils/check_sources.py @@ -30,7 +30,7 @@ def checker(*suffixes, **kwds): name_mail_re = r'[\w ]+(<.*?>)?' -copyright_re = re.compile(r'^ :copyright: Copyright 200\d(-200\d)?' +copyright_re = re.compile(r'^ :copyright: Copyright 200\d(-200\d)? ' r'by %s(, %s)*[,.]$' % (name_mail_re, name_mail_re)) license_re = re.compile(r" :license: (.*?).\n") @@ -56,7 +56,7 @@ def check_syntax(fn, lines): def check_style_and_encoding(fn, lines): encoding = 'ascii' for lno, line in enumerate(lines): - if len(line) > 90: + if len(line) > 81: yield lno+1, "line too long" if lno < 2: co = coding_re.search(line) @@ -64,9 +64,9 @@ def check_style_and_encoding(fn, lines): encoding = co.group(1) if line.strip().startswith('#'): continue - m = not_ix_re.search(line) - if m: - yield lno+1, '"' + m.group() + '"' + #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' try: @@ -142,7 +142,7 @@ def check_fileheader(fn, lines): yield 0, "no correct copyright info" -@checker('.py', '.html') +@checker('.py', '.html', '.rst') def check_whitespace_and_spelling(fn, lines): for lno, line in enumerate(lines): if "\t" in line: @@ -154,7 +154,7 @@ def check_whitespace_and_spelling(fn, lines): yield lno+1, '"%s" used' % word -bad_tags = ('<b>', '<i>', '<u>', '<s>', '<strike>' +bad_tags = ('<u>', '<s>', '<strike>' '<center>', '<big>', '<small>', '<font') @checker('.html') diff --git a/utils/reindent.py b/utils/reindent.py index e6ee8287..c499f671 100755 --- a/utils/reindent.py +++ b/utils/reindent.py @@ -8,7 +8,8 @@ -d (--dryrun) Dry run. Analyze, but don't make any changes to files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -B (--no-backup) Don't write .bak backup files. --v (--verbose) Verbose. Print informative msgs; else only names of changed files. +-v (--verbose) Verbose. Print informative msgs; else only names of \ +changed files. -h (--help) Help. Print this usage information and exit. Change Python (.py) files to use 4-space indents and no hard tab characters. @@ -118,7 +119,8 @@ def check(file): if dryrun: print "But this is a dry run, so leaving it alone." else: - print "reindented", file, (dryrun and "(dry run => not really)" or "") + print "reindented", file, \ + (dryrun and "(dry run => not really)" or "") if not dryrun: if not no_backup: bak = file + ".bak" |
