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

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

Issue 29977590: Issue 7196 - Centralize flake8 configuration
Patch Set: Created Jan. 10, 2019, 2:38 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
« no previous file with comments | « cms-dev/tox.ini ('k') | flake8-eyeo/setup.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 is_compare_in_assign = ( 487 is_compare_in_assign = (
488 isinstance(parent, (ast.Assign, ast.keyword)) and 488 isinstance(parent, (ast.Assign, ast.keyword)) and
489 any(isinstance(x, ast.Compare) for x in ast.walk(node)) 489 any(isinstance(x, ast.Compare) for x in ast.walk(node))
490 ) 490 )
491 if is_tuple or is_nested_op or is_compare_in_assign: 491 if is_tuple or is_nested_op or is_compare_in_assign:
492 continue 492 continue
493 493
494 yield (pos[0], pos[1], 'A111 redundant parenthesis', None) 494 yield (pos[0], pos[1], 'A111 redundant parenthesis', None)
495 495
496 496
497 for checker in [check_ast, check_non_default_encoding, 497 class DefaultConfigOverride:
498 check_quotes, check_redundant_parenthesis]: 498 def __init__(self, _):
499 pass
500
501 @classmethod
502 def add_options(cls, parser):
503 parser.extend_default_ignore([
504 # We don't want to make doc strings mandatory
505 # but merely lint existing doc strings.
506 'D1',
507 # Adding a comma after variable args/kwargs
508 # is a syntax error in Python 2 (and <= 3.4).
509 'C815',
510 ])
511
512 # Remove everything but W503 & W504 from the built-in default ignores.
513 parser.parser.defaults['ignore'] = 'W503,W504'
514
515
516 for checker in [check_ast, check_non_default_encoding, check_quotes,
517 check_redundant_parenthesis, DefaultConfigOverride]:
499 checker.name = 'eyeo' 518 checker.name = 'eyeo'
500 checker.version = __version__ 519 checker.version = __version__
OLDNEW
« no previous file with comments | « cms-dev/tox.ini ('k') | flake8-eyeo/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld