From 59035767329af1a6e29b9b16f172064102d4bdee Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sun, 10 Jan 2016 14:36:52 -0600 Subject: [PATCH] Ignore only D203 and fix Flake8 errors --- flake8/__init__.py | 14 ++++++++++++++ flake8/_trie.py | 2 +- flake8/notifier.py | 3 +++ flake8/options/__init__.py | 12 ++++++++++++ flake8/options/manager.py | 4 ++-- flake8/style_guide.py | 1 + tests/unit/test_merged_config_parser.py | 1 + tox.ini | 3 +++ 8 files changed, 37 insertions(+), 3 deletions(-) diff --git a/flake8/__init__.py b/flake8/__init__.py index 6f33c82..50dc71c 100644 --- a/flake8/__init__.py +++ b/flake8/__init__.py @@ -1,3 +1,14 @@ +"""Top-level module for Flake8. + +This module + +- initializes logging for the command-line tool +- tracks the version of the package +- provides a way to configure logging for the command-line tool + +.. autofunction:: flake8.configure_logging + +""" import logging import sys @@ -5,7 +16,10 @@ try: from logging import NullHandler except ImportError: class NullHandler(logging.Handler): + """Shim for version of Python < 2.7.""" + def emit(self, record): + """Do nothing.""" pass LOG = logging.getLogger(__name__) diff --git a/flake8/_trie.py b/flake8/_trie.py index 858c067..4871abb 100644 --- a/flake8/_trie.py +++ b/flake8/_trie.py @@ -5,7 +5,7 @@ __all__ = ('Trie', 'TrieNode') def _iterate_stringlike_objects(string): for i in range(len(string)): - yield string[i:i+1] + yield string[i:i + 1] class Trie(object): diff --git a/flake8/notifier.py b/flake8/notifier.py index 6bf51ef..e7bf3ba 100644 --- a/flake8/notifier.py +++ b/flake8/notifier.py @@ -1,7 +1,10 @@ +"""Implementation of the class that registers and notifies listeners.""" from flake8 import _trie class Notifier(object): + """Object that tracks and notifies listener objects.""" + def __init__(self): """Initialize an empty notifier object.""" self.listeners = _trie.Trie() diff --git a/flake8/options/__init__.py b/flake8/options/__init__.py index e69de29..cc20daa 100644 --- a/flake8/options/__init__.py +++ b/flake8/options/__init__.py @@ -0,0 +1,12 @@ +"""Package containing the option manager and config management logic. + +- :mod:`flake8.options.config` contains the logic for finding, parsing, and + merging configuration files. + +- :mod:`flake8.options.manager` contains the logic for managing customized + Flake8 command-line and configuration options. + +- :mod:`flake8.options.aggregator` uses objects from both of the above modules + to aggregate configuration into one object used by plugins and Flake8. + +""" diff --git a/flake8/options/manager.py b/flake8/options/manager.py index c4da8e0..d328a1f 100644 --- a/flake8/options/manager.py +++ b/flake8/options/manager.py @@ -104,8 +104,8 @@ class Option(object): 'dest={dest}, type={type}, callback={callback}, help={help},' ' callback={callback}, callback_args={callback_args}, ' 'callback_kwargs={callback_kwargs}, metavar={metavar})' - ).format(self.short_option_name, self.long_option_name, - **self.option_kwargs) + ).format(self.short_option_name, self.long_option_name, + **self.option_kwargs) def _make_dest(self, dest): if dest: diff --git a/flake8/style_guide.py b/flake8/style_guide.py index e69de29..a3f63eb 100644 --- a/flake8/style_guide.py +++ b/flake8/style_guide.py @@ -0,0 +1 @@ +"""Implementation of the StyleGuide used by Flake8.""" diff --git a/tests/unit/test_merged_config_parser.py b/tests/unit/test_merged_config_parser.py index 028ad18..96f6aae 100644 --- a/tests/unit/test_merged_config_parser.py +++ b/tests/unit/test_merged_config_parser.py @@ -40,6 +40,7 @@ def test_creates_its_own_config_file_finder(args, extra_config_files, def test_parse_cli_config(optmanager): + """Parse the specified config file as a cli config file.""" optmanager.add_option('--exclude', parse_from_config=True, comma_separated_list=True, normalize_paths=True) diff --git a/tox.ini b/tox.ini index 650c16e..8d9d425 100644 --- a/tox.ini +++ b/tox.ini @@ -7,3 +7,6 @@ deps = pytest commands = py.test {posargs} + +[flake8] +ignore = D203