Skip to content

Commit

Permalink
Update run_tests.py for flake8 >= 5 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
jparise authored Aug 18, 2022
1 parent e746ff5 commit c8808a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import sys

import flake8
from flake8.options.manager import OptionManager
import pep8ext_naming

Expand Down Expand Up @@ -71,16 +72,20 @@ def load_tests(lines):

def parse_options(checker, options):
"""Parse the CLI-style flags from `options` and expose to `checker`"""
options_manager = OptionManager('flake8', version=pep8ext_naming.__version__)
options_manager = OptionManager(
version=flake8.__version__,
plugin_versions=f"naming: {pep8ext_naming.__version__}",
parents=[],
)
options_manager.add_option('--select', default=[])
options_manager.add_option('--extended-default-select', default=['N'])
options_manager.add_option('--extend-select', default=[])
options_manager.add_option('--extend-select', default=['N'])
options_manager.add_option('--ignore', default=[])
options_manager.add_option('--extend-ignore', default=[])
options_manager.add_option('--enable-extensions', default=[])
options_manager.add_option('--extended-default-ignore', default=[])
checker.add_options(options_manager)
processed_options, _ = options_manager.parse_args(options)
processed_options = options_manager.parse_args(options)
checker.parse_options(processed_options)


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ python =

[testenv]
commands = python run_tests.py
deps =
flake8 >= 5.0.0

[testenv:py310-flake8]
basepython = python3.10
deps =
flake8 >= 3.9.2
commands =
flake8 {posargs} src/pep8ext_naming.py
python setup.py check --restructuredtext
Expand Down

0 comments on commit c8808a0

Please sign in to comment.