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

Unified Diff: flake8-eyeo/flake8_eyeo.py

Issue 29977590: Issue 7196 - Centralize flake8 configuration
Patch Set: Created Jan. 10, 2019, 2:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cms-dev/tox.ini ('k') | flake8-eyeo/setup.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: flake8-eyeo/flake8_eyeo.py
===================================================================
--- a/flake8-eyeo/flake8_eyeo.py
+++ b/flake8-eyeo/flake8_eyeo.py
@@ -494,7 +494,26 @@
yield (pos[0], pos[1], 'A111 redundant parenthesis', None)
-for checker in [check_ast, check_non_default_encoding,
- check_quotes, check_redundant_parenthesis]:
+class DefaultConfigOverride:
+ def __init__(self, _):
+ pass
+
+ @classmethod
+ def add_options(cls, parser):
+ parser.extend_default_ignore([
+ # We don't want to make doc strings mandatory
+ # but merely lint existing doc strings.
+ 'D1',
+ # Adding a comma after variable args/kwargs
+ # is a syntax error in Python 2 (and <= 3.4).
+ 'C815',
+ ])
+
+ # Remove everything but W503 & W504 from the built-in default ignores.
+ parser.parser.defaults['ignore'] = 'W503,W504'
+
+
+for checker in [check_ast, check_non_default_encoding, check_quotes,
+ check_redundant_parenthesis, DefaultConfigOverride]:
checker.name = 'eyeo'
checker.version = __version__
« 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