Mercurial > public > mercurial-scm > hg-stable
comparison doc/hgmanpage.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 | 15036492a103 |
children | 9de689d20230 |
comparison
equal
deleted
inserted
replaced
18053:0c2f0048125d | 18054:b35e3364f94a |
---|---|
144 cell = row[i] | 144 cell = row[i] |
145 self._minimize_cell(cell) | 145 self._minimize_cell(cell) |
146 text.extend(cell) | 146 text.extend(cell) |
147 if not text[-1].endswith('\n'): | 147 if not text[-1].endswith('\n'): |
148 text[-1] += '\n' | 148 text[-1] += '\n' |
149 if i < len(row)-1: | 149 if i < len(row) - 1: |
150 text.append('T}'+self._tab_char+'T{\n') | 150 text.append('T}'+self._tab_char+'T{\n') |
151 else: | 151 else: |
152 text.append('T}\n') | 152 text.append('T}\n') |
153 text.append('_\n') | 153 text.append('_\n') |
154 text.append('.TE\n') | 154 text.append('.TE\n') |
256 """Return the final formatted document as a string.""" | 256 """Return the final formatted document as a string.""" |
257 if not self.header_written: | 257 if not self.header_written: |
258 # ensure we get a ".TH" as viewers require it. | 258 # ensure we get a ".TH" as viewers require it. |
259 self.head.append(self.header()) | 259 self.head.append(self.header()) |
260 # filter body | 260 # filter body |
261 for i in xrange(len(self.body)-1, 0, -1): | 261 for i in xrange(len(self.body) - 1, 0, -1): |
262 # remove superfluous vertical gaps. | 262 # remove superfluous vertical gaps. |
263 if self.body[i] == '.sp\n': | 263 if self.body[i] == '.sp\n': |
264 if self.body[i - 1][:4] in ('.BI ','.IP '): | 264 if self.body[i - 1][:4] in ('.BI ','.IP '): |
265 self.body[i] = '.\n' | 265 self.body[i] = '.\n' |
266 elif (self.body[i - 1][:3] == '.B ' and | 266 elif (self.body[i - 1][:3] == '.B ' and |
878 | 878 |
879 def visit_option_argument(self, node): | 879 def visit_option_argument(self, node): |
880 self.context[-3] = '.BI' # bold/italic alternate | 880 self.context[-3] = '.BI' # bold/italic alternate |
881 if node['delimiter'] != ' ': | 881 if node['delimiter'] != ' ': |
882 self.body.append('\\fB%s ' % node['delimiter']) | 882 self.body.append('\\fB%s ' % node['delimiter']) |
883 elif self.body[len(self.body)-1].endswith('='): | 883 elif self.body[len(self.body) - 1].endswith('='): |
884 # a blank only means no blank in output, just changing font | 884 # a blank only means no blank in output, just changing font |
885 self.body.append(' ') | 885 self.body.append(' ') |
886 else: | 886 else: |
887 # blank backslash blank, switch font then a blank | 887 # blank backslash blank, switch font then a blank |
888 self.body.append(' \\ ') | 888 self.body.append(' \\ ') |