Skip to content

Commit

Permalink
support flake8 3.8 (#140)
Browse files Browse the repository at this point in the history
* support flake8 3.8

* rename variable to pass flake8 3.8
  • Loading branch information
dirk-thomas authored May 12, 2020
1 parent 218fcfe commit bb9a810
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions test/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,25 @@ def get_style_guide(argv=None):
# this is a fork of flake8.api.legacy.get_style_guide
# to allow passing command line argument
application = Application()
application.parse_preliminary_options_and_args([])
application.make_config_finder()
application.find_plugins()
application.register_plugin_options()
application.parse_configuration_and_cli(argv)
if hasattr(application, 'parse_preliminary_options'):
prelim_opts, remaining_args = application.parse_preliminary_options(
argv)
from flake8 import configure_logging
configure_logging(prelim_opts.verbose, prelim_opts.output_file)
from flake8.options import config
config_finder = config.ConfigFileFinder(
application.program, prelim_opts.append_config,
config_file=prelim_opts.config,
ignore_config_files=prelim_opts.isolated)
application.find_plugins(config_finder)
application.register_plugin_options()
application.parse_configuration_and_cli(config_finder, remaining_args)
else:
application.parse_preliminary_options_and_args([])
application.make_config_finder()
application.find_plugins()
application.register_plugin_options()
application.parse_configuration_and_cli(argv)
application.make_formatter()
application.make_guide()
application.make_file_checker_manager()
Expand Down
2 changes: 1 addition & 1 deletion vcstool/clients/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def branch(self, command):
if not command.all and not result['returncode']:
# only show current branch
lines = result['output'].splitlines()
lines = [l[2:] for l in lines if l.startswith('* ')]
lines = [line[2:] for line in lines if line.startswith('* ')]
result['output'] = '\n'.join(lines)

return result
Expand Down

0 comments on commit bb9a810

Please sign in to comment.