summaryrefslogtreecommitdiff
path: root/src/flake8/api
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-20 07:31:42 -0500
committerIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-20 12:37:14 -0500
commitc58a4662d8920cf70ea688edd9eaf9d783a856a7 (patch)
tree6dda552de1b7250ccd1347a7ebc62dc69b9ff0c0 /src/flake8/api
parenta2b7a7e4c590d73acc77a17ff8b0450e3b9b81d8 (diff)
downloadflake8-c58a4662d8920cf70ea688edd9eaf9d783a856a7.tar.gz
Use black to reformat Flake8
Instead of just using Flake8 and pylint to keep Flake8 clean, let's also use black to make it less manual for clean-up.
Diffstat (limited to 'src/flake8/api')
-rw-r--r--src/flake8/api/legacy.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index b332860..2a3f10b 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -13,7 +13,7 @@ from flake8.main import application as app
LOG = logging.getLogger(__name__)
-__all__ = ('get_style_guide',)
+__all__ = ("get_style_guide",)
def get_style_guide(**kwargs):
@@ -29,7 +29,8 @@ def get_style_guide(**kwargs):
application = app.Application()
application.parse_preliminary_options_and_args([])
flake8.configure_logging(
- application.prelim_opts.verbose, application.prelim_opts.output_file)
+ application.prelim_opts.verbose, application.prelim_opts.output_file
+ )
application.make_config_finder()
application.find_plugins()
application.register_plugin_options()
@@ -113,18 +114,22 @@ class StyleGuide(object):
:rtype:
bool
"""
- return (self._file_checker_manager.is_path_excluded(filename) or
- (parent and
- self._file_checker_manager.is_path_excluded(
- os.path.join(parent, filename))))
+ return self._file_checker_manager.is_path_excluded(filename) or (
+ parent
+ and self._file_checker_manager.is_path_excluded(
+ os.path.join(parent, filename)
+ )
+ )
def init_report(self, reporter=None):
"""Set up a formatter for this run of Flake8."""
if reporter is None:
return
if not issubclass(reporter, formatter.BaseFormatter):
- raise ValueError("Report should be subclass of "
- "flake8.formatter.BaseFormatter.")
+ raise ValueError(
+ "Report should be subclass of "
+ "flake8.formatter.BaseFormatter."
+ )
self._application.formatter = None
self._application.make_formatter(reporter)
self._application.guide = None
@@ -197,6 +202,6 @@ class Report(object):
list
"""
return [
- '{} {} {}'.format(s.count, s.error_code, s.message)
+ "{} {} {}".format(s.count, s.error_code, s.message)
for s in self._stats.statistics_for(violation)
]