Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: flake8-eyeo/flake8_eyeo.py

Issue 29569634: Noissue - Added flake8-docstrings (codingtools) (Closed)
Patch Set: Created Oct. 9, 2017, 1:53 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 # This file is part of Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 prefixes, quote, text = match.groups() 390 prefixes, quote, text = match.groups()
391 prefixes = prefixes.lower() 391 prefixes = prefixes.lower()
392 392
393 if 'u' in prefixes: 393 if 'u' in prefixes:
394 yield (start, 'A112 use "from __future__ import ' 394 yield (start, 'A112 use "from __future__ import '
395 'unicode_literals" instead of ' 395 'unicode_literals" instead of '
396 'prefixing literals with "u"') 396 'prefixing literals with "u"')
397 397
398 if first_token and re.search(r'^(?:(?:def|class)\s|$)', 398 if first_token and re.search(r'^(?:(?:def|class)\s|$)',
399 previous_logical): 399 previous_logical):
400 if quote != '"""': 400 pass # Ignore docstrings
401 yield (start, 'A109 use triple double '
402 'quotes for docstrings')
403 elif start[0] != end[0]: 401 elif start[0] != end[0]:
404 pass 402 pass # Ignore multiline strings
Sebastian Noack 2017/10/09 02:08:58 These are checked by flake8-docstrings now.
405 elif 'r' in prefixes: 403 elif 'r' in prefixes:
406 if quote != "'" and not (quote == '"' and "'" in text): 404 if quote != "'" and not (quote == '"' and "'" in text):
407 yield (start, 'A110 use single quotes for raw string') 405 yield (start, 'A110 use single quotes for raw string')
408 else: 406 else:
409 prefix = '' 407 prefix = ''
410 if sys.version_info[0] >= 3: 408 if sys.version_info[0] >= 3:
411 if 'b' in prefixes: 409 if 'b' in prefixes:
412 prefix = 'b' 410 prefix = 'b'
413 else: 411 else:
414 u_literals = checker_state.get('has_unicode_literals') 412 u_literals = checker_state.get('has_unicode_literals')
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 return [(pos, 'A111 redundant parenthesis for {} ' 469 return [(pos, 'A111 redundant parenthesis for {} '
472 'statement'.format(statement))] 470 'statement'.format(statement))]
473 471
474 return [] 472 return []
475 473
476 474
477 for checker in [ASTChecker, check_non_default_encoding, 475 for checker in [ASTChecker, check_non_default_encoding,
478 check_quotes, check_redundant_parenthesis]: 476 check_quotes, check_redundant_parenthesis]:
479 checker.name = 'eyeo' 477 checker.name = 'eyeo'
480 checker.version = __version__ 478 checker.version = __version__
OLDNEW
« no previous file with comments | « flake8-eyeo/README.md ('k') | flake8-eyeo/tests/A109.py » ('j') | flake8-eyeo/tox.ini » ('J')

Powered by Google App Engine
This is Rietveld