Mercurial > hg
comparison mercurial/ignore.py @ 18054:b35e3364f94a
check-code: there must also be whitespace between ')' and operator
The check pattern only checked for whitespace between keyword and operator.
Now it also warns:
> x = f(),7
missing whitespace after ,
> x = f()+7
missing whitespace in expression
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 09 Dec 2012 23:33:16 +0100 |
parents | ee112eb69d2a |
children | 5712e3b12274 |
comparison
equal
deleted
inserted
replaced
18053:0c2f0048125d | 18054:b35e3364f94a |
---|---|
44 for s, rels in syntaxes.iteritems(): | 44 for s, rels in syntaxes.iteritems(): |
45 if line.startswith(rels): | 45 if line.startswith(rels): |
46 pat = line | 46 pat = line |
47 break | 47 break |
48 elif line.startswith(s+':'): | 48 elif line.startswith(s+':'): |
49 pat = rels + line[len(s)+1:] | 49 pat = rels + line[len(s) + 1:] |
50 break | 50 break |
51 patterns.append(pat) | 51 patterns.append(pat) |
52 | 52 |
53 return patterns, warnings | 53 return patterns, warnings |
54 | 54 |