mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-03 19:56:54 +00:00
Ignore only D203 and fix Flake8 errors
This commit is contained in:
parent
a8576aff12
commit
5903576732
8 changed files with 37 additions and 3 deletions
|
|
@ -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__)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
"""
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
"""Implementation of the StyleGuide used by Flake8."""
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
3
tox.ini
3
tox.ini
|
|
@ -7,3 +7,6 @@ deps =
|
|||
pytest
|
||||
commands =
|
||||
py.test {posargs}
|
||||
|
||||
[flake8]
|
||||
ignore = D203
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue