##// END OF EJS Templates
check-code: make repquote distinguish more characters for exact detection...
FUJIWARA Katsunori -
r29279:438caf19 default
parent child Browse files
Show More
@@ -53,7 +53,8 b' def compilere(pat, multiline=False):'
53 def repquote(m):
53 def repquote(m):
54 # check "rules depending on implementation of repquote()" in each
54 # check "rules depending on implementation of repquote()" in each
55 # patterns (especially pypats), before changing this function
55 # patterns (especially pypats), before changing this function
56 fixedmap = {' ': ' ', '\n': '\n', '.': 'p', ':': 'q'}
56 fixedmap = {' ': ' ', '\n': '\n', '.': 'p', ':': 'q',
57 '%': '%', '\\': 'b', '*': 'A', '+': 'P', '-': 'M'}
57 def encodechr(i):
58 def encodechr(i):
58 if i > 255:
59 if i > 255:
59 return 'u'
60 return 'u'
@@ -326,7 +327,8 b' pypats = ['
326 (r'\.next\(\)', "don't use .next(), use next(...)"),
327 (r'\.next\(\)', "don't use .next(), use next(...)"),
327
328
328 # rules depending on implementation of repquote()
329 # rules depending on implementation of repquote()
329 (r' x+[xpqo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
330 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x',
331 'string join across lines with no space'),
330 (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
332 (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
331 "missing _() in ui message (use () to hide false-positives)"),
333 "missing _() in ui message (use () to hide false-positives)"),
332 ],
334 ],
@@ -256,6 +256,10 b' web templates'
256 > 'bar foo.'
256 > 'bar foo.'
257 > 'bar foo:'
257 > 'bar foo:'
258 > 'bar foo@'
258 > 'bar foo@'
259 > 'bar foo%'
260 > 'bar foo*'
261 > 'bar foo+'
262 > 'bar foo-'
259 > 'bar')
263 > 'bar')
260 > EOF
264 > EOF
261 $ "$check_code" stringjoin.py
265 $ "$check_code" stringjoin.py
@@ -271,4 +275,16 b' web templates'
271 stringjoin.py:4:
275 stringjoin.py:4:
272 > 'bar foo@'
276 > 'bar foo@'
273 string join across lines with no space
277 string join across lines with no space
278 stringjoin.py:5:
279 > 'bar foo%'
280 string join across lines with no space
281 stringjoin.py:6:
282 > 'bar foo*'
283 string join across lines with no space
284 stringjoin.py:7:
285 > 'bar foo+'
286 string join across lines with no space
287 stringjoin.py:8:
288 > 'bar foo-'
289 string join across lines with no space
274 [1]
290 [1]
General Comments 0
You need to be logged in to leave comments. Login now