149 <tr> |
149 <tr> |
150 <td><a href="#is_string_literal">is_string_literal</a></td> |
150 <td><a href="#is_string_literal">is_string_literal</a></td> |
151 <td></td> |
151 <td></td> |
152 </tr> |
152 </tr> |
153 <tr> |
153 <tr> |
154 <td><a href="#lru_cache">lru_cache</a></td> |
|
155 <td></td> |
|
156 </tr> |
|
157 <tr> |
|
158 <td><a href="#maximum_doc_length">maximum_doc_length</a></td> |
154 <td><a href="#maximum_doc_length">maximum_doc_length</a></td> |
159 <td>Limit all doc lines to a maximum of 72 characters.</td> |
155 <td>Limit all doc lines to a maximum of 72 characters.</td> |
160 </tr> |
156 </tr> |
161 <tr> |
157 <tr> |
162 <td><a href="#maximum_line_length">maximum_line_length</a></td> |
158 <td><a href="#maximum_line_length">maximum_line_length</a></td> |
165 <tr> |
161 <tr> |
166 <td><a href="#missing_whitespace">missing_whitespace</a></td> |
162 <td><a href="#missing_whitespace">missing_whitespace</a></td> |
167 <td>Each comma, semicolon or colon should be followed by whitespace.</td> |
163 <td>Each comma, semicolon or colon should be followed by whitespace.</td> |
168 </tr> |
164 </tr> |
169 <tr> |
165 <tr> |
170 <td><a href="#missing_whitespace_after_import_keyword">missing_whitespace_after_import_keyword</a></td> |
166 <td><a href="#missing_whitespace_after_keyword">missing_whitespace_after_keyword</a></td> |
171 <td>Multiple imports in form from x import (a, b, c) should have space between import statement and parenthesised name list.</td> |
167 <td>Keywords should be followed by whitespace.</td> |
172 </tr> |
168 </tr> |
173 <tr> |
169 <tr> |
174 <td><a href="#missing_whitespace_around_operator">missing_whitespace_around_operator</a></td> |
170 <td><a href="#missing_whitespace_around_operator">missing_whitespace_around_operator</a></td> |
175 <td>Surround operators with a single space on either side.</td> |
171 <td>Surround operators with a single space on either side.</td> |
176 </tr> |
172 </tr> |
225 <tr> |
221 <tr> |
226 <td><a href="#readlines">readlines</a></td> |
222 <td><a href="#readlines">readlines</a></td> |
227 <td>Read the source code.</td> |
223 <td>Read the source code.</td> |
228 </tr> |
224 </tr> |
229 <tr> |
225 <tr> |
230 <td><a href="#readlines_1">readlines</a></td> |
|
231 <td>Read the source code.</td> |
|
232 </tr> |
|
233 <tr> |
|
234 <td><a href="#register_check">register_check</a></td> |
226 <td><a href="#register_check">register_check</a></td> |
235 <td>Register a new check object.</td> |
227 <td>Register a new check object.</td> |
236 </tr> |
228 </tr> |
237 <tr> |
229 <tr> |
238 <td><a href="#stdin_get_value">stdin_get_value</a></td> |
230 <td><a href="#stdin_get_value">stdin_get_value</a></td> |
1458 <b>is_string_literal</b>(<i>line</i>) |
1450 <b>is_string_literal</b>(<i>line</i>) |
1459 |
1451 |
1460 <div align="right"><a href="#top">Up</a></div> |
1452 <div align="right"><a href="#top">Up</a></div> |
1461 <hr /> |
1453 <hr /> |
1462 <hr /> |
1454 <hr /> |
1463 <a NAME="lru_cache" ID="lru_cache"></a> |
|
1464 <h2>lru_cache</h2> |
|
1465 <b>lru_cache</b>(<i>maxsize=128</i>) |
|
1466 |
|
1467 <div align="right"><a href="#top">Up</a></div> |
|
1468 <hr /> |
|
1469 <hr /> |
|
1470 <a NAME="maximum_doc_length" ID="maximum_doc_length"></a> |
1455 <a NAME="maximum_doc_length" ID="maximum_doc_length"></a> |
1471 <h2>maximum_doc_length</h2> |
1456 <h2>maximum_doc_length</h2> |
1472 <b>maximum_doc_length</b>(<i>logical_line, max_doc_length, noqa, tokens</i>) |
1457 <b>maximum_doc_length</b>(<i>logical_line, max_doc_length, noqa, tokens</i>) |
1473 |
1458 |
1474 <p> |
1459 <p> |
1524 E231: [{'a':'b'}] |
1509 E231: [{'a':'b'}] |
1525 </p> |
1510 </p> |
1526 <div align="right"><a href="#top">Up</a></div> |
1511 <div align="right"><a href="#top">Up</a></div> |
1527 <hr /> |
1512 <hr /> |
1528 <hr /> |
1513 <hr /> |
1529 <a NAME="missing_whitespace_after_import_keyword" ID="missing_whitespace_after_import_keyword"></a> |
1514 <a NAME="missing_whitespace_after_keyword" ID="missing_whitespace_after_keyword"></a> |
1530 <h2>missing_whitespace_after_import_keyword</h2> |
1515 <h2>missing_whitespace_after_keyword</h2> |
1531 <b>missing_whitespace_after_import_keyword</b>(<i>logical_line</i>) |
1516 <b>missing_whitespace_after_keyword</b>(<i>logical_line, tokens</i>) |
1532 |
1517 |
1533 <p> |
1518 <p> |
1534 Multiple imports in form from x import (a, b, c) should have |
1519 Keywords should be followed by whitespace. |
1535 space between import statement and parenthesised name list. |
|
1536 </p> |
1520 </p> |
1537 <p> |
1521 <p> |
1538 Okay: from foo import (bar, baz) |
1522 Okay: from foo import (bar, baz) |
1539 E275: from foo import(bar, baz) |
1523 E275: from foo import(bar, baz) |
1540 E275: from importable.module import(bar, baz) |
1524 E275: from importable.module import(bar, baz) |
|
1525 E275: if(foo): bar |
1541 </p> |
1526 </p> |
1542 <div align="right"><a href="#top">Up</a></div> |
1527 <div align="right"><a href="#top">Up</a></div> |
1543 <hr /> |
1528 <hr /> |
1544 <hr /> |
1529 <hr /> |
1545 <a NAME="missing_whitespace_around_operator" ID="missing_whitespace_around_operator"></a> |
1530 <a NAME="missing_whitespace_around_operator" ID="missing_whitespace_around_operator"></a> |
1787 Read the source code. |
1772 Read the source code. |
1788 </p> |
1773 </p> |
1789 <div align="right"><a href="#top">Up</a></div> |
1774 <div align="right"><a href="#top">Up</a></div> |
1790 <hr /> |
1775 <hr /> |
1791 <hr /> |
1776 <hr /> |
1792 <a NAME="readlines_1" ID="readlines_1"></a> |
|
1793 <h2>readlines</h2> |
|
1794 <b>readlines</b>(<i>filename</i>) |
|
1795 |
|
1796 <p> |
|
1797 Read the source code. |
|
1798 </p> |
|
1799 <div align="right"><a href="#top">Up</a></div> |
|
1800 <hr /> |
|
1801 <hr /> |
|
1802 <a NAME="register_check" ID="register_check"></a> |
1777 <a NAME="register_check" ID="register_check"></a> |
1803 <h2>register_check</h2> |
1778 <h2>register_check</h2> |
1804 <b>register_check</b>(<i>check, codes=None</i>) |
1779 <b>register_check</b>(<i>check, codes=None</i>) |
1805 |
1780 |
1806 <p> |
1781 <p> |
1996 An inline comment is a comment on the same line as a statement. |
1971 An inline comment is a comment on the same line as a statement. |
1997 Inline comments should be separated by at least two spaces from the |
1972 Inline comments should be separated by at least two spaces from the |
1998 statement. They should start with a # and a single space. |
1973 statement. They should start with a # and a single space. |
1999 </p> |
1974 </p> |
2000 <p> |
1975 <p> |
2001 Each line of a block comment starts with a # and a single space |
1976 Each line of a block comment starts with a # and one or multiple |
2002 (unless it is indented text inside the comment). |
1977 spaces as there can be indented text inside the comment. |
2003 </p> |
1978 </p> |
2004 <p> |
1979 <p> |
2005 Okay: x = x + 1 # Increment x |
1980 Okay: x = x + 1 # Increment x |
2006 Okay: x = x + 1 # Increment x |
1981 Okay: x = x + 1 # Increment x |
2007 Okay: # Block comment |
1982 Okay: # Block comments: |
|
1983 Okay: # - Block comment list |
|
1984 Okay: # \xa0- Block comment list |
2008 E261: x = x + 1 # Increment x |
1985 E261: x = x + 1 # Increment x |
2009 E262: x = x + 1 #Increment x |
1986 E262: x = x + 1 #Increment x |
2010 E262: x = x + 1 # Increment x |
1987 E262: x = x + 1 # Increment x |
|
1988 E262: x = x + 1 # \xa0Increment x |
2011 E265: #Block comment |
1989 E265: #Block comment |
2012 E266: ### Block comment |
1990 E266: ### Block comment |
2013 </p> |
1991 </p> |
2014 <div align="right"><a href="#top">Up</a></div> |
1992 <div align="right"><a href="#top">Up</a></div> |
2015 <hr /> |
1993 <hr /> |