Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e41d4c8

Browse files
committed
Added doubled word warnings.
1 parent 999b57c commit e41d4c8

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/ref/ref3.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ \subsection{Additional methods for emulation of sequence types
17401740
indexes by the built-in sequence types, and the \method{__*item__()}
17411741
methods are expected to do this as well. However, since they should
17421742
already be doing that, negative indexes cannot be passed in; they must
1743-
be be constrained to the bounds of the sequence before being passed to
1743+
be constrained to the bounds of the sequence before being passed to
17441744
the \method{__*item__()} methods.
17451745
Calling \code{max(0, i)} conveniently returns the proper value.
17461746

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Library
5555
Tools/Demos
5656
-----------
5757

58+
- texcheck.py now detects double word errors.
59+
5860
- md5sum.py mistakenly opened input files in text mode by default, a
5961
silent and dangerous change from previous releases. It once again
6062
opens input files in binary mode by default. The -t and -b flags

Tools/scripts/texcheck.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def checkit(source, opts, morecmds=[]):
9898

9999
delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])')
100100
braces = re.compile(r'({)|(})')
101+
doubledwords = re.compile(r'(\b[A-za-z]+\b) \b\1\b')
101102

102103
openers = [] # Stack of pending open delimiters
103104
bracestack = [] # Stack of pending open braces
@@ -175,6 +176,8 @@ def checkit(source, opts, morecmds=[]):
175176
if 'e.g.' in line or 'i.e.' in line:
176177
print r'Style warning, avoid use of i.e or e.g. on line %d' % (lineno,)
177178

179+
for dw in doubledwords.findall(line):
180+
print r'Doubled word warning. "%s" on line %d' % (dw, lineno)
178181

179182
lastline = lineno
180183
for lineno, symbol in openers:

0 commit comments

Comments
 (0)