Repository: wemake-services/wemake-python-styleguide

Issue:
flake8 versions prior 3.7.8 fails to process nested classes whitelist option
# Bug report
## What's wrong
Option processing in flake8 versions prior 3.7.8 differs from later option processing, and defaults of nested class whitelist options break flake8 at startup.

I bisected this problem to flake8 commit fb7e9338cd06760a2f9096f976f0e246fc36a09e, when changes in flake8/utils.py function parse_comma_separated_list were made.

To solve this problem either minimal flake8 version should be increased to 3.7.8 or type of nested class whitelist option [defaults](https://github.com/wemake-services/wemake-python-styleguide/blob/f39e87897de89bea1c49d410beb5b1cbaf930807/wemake_python_styleguide/options/defaults.py#L36) should be changed.


```
$ flake8

Traceback (most recent call last):
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/bin/.flake8-wrapped", line 11, in <module>
    sys.exit(main())
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 394, in run
    self._run(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 381, in _run
    self.initialize(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 366, in initialize
    self.parse_configuration_and_cli(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 219, in parse_configuration_and_cli
    self.option_manager, self.config_finder, argv
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/aggregator.py", line 33, in aggregate_options
    default_values, _ = manager.parse_args([], values=values)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 312, in parse_args
    self._normalize(options)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 305, in _normalize
    setattr(options, option.dest, option.normalize(old_value))
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 151, in normalize
    return utils.parse_comma_separated_list(value)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/utils.py", line 44, in parse_comma_separated_list
    value = regexp.split(value)
TypeError: expected string or bytes-like object
```

## How is that should be

flake8 should work.

### System information
NixOS 19.09.1484.84586a4514d (Loris)

### flake8 information

`flake8 --bug-report` fails with the same error

### pip information

Contents of `pip freeze`:
```
astor==0.8.0
attrs==18.2.0
bandit==1.6.2
cognitive-complexity==0.0.4
colorama==0.4.1
darglint==1.1.0
ddt==1.2.1
docutils==0.14
entrypoints==0.3
eradicate==1.0
flake8==3.7.7
flake8-annotations-complexity==0.0.2
flake8-bandit==2.1.2
flake8-broken-line==0.1.1
flake8-bugbear==19.8.0
flake8-builtins==1.4.2
flake8-coding==1.3.2
flake8-commas==2.0.0
flake8-comprehensions==3.1.4
flake8-debugger==3.1.0
flake8-docstrings==1.5.0
flake8-eradicate==0.2.4
flake8-executable==2.0.3
flake8-isort==2.8.0
flake8-logging-format==0.6.0
flake8-pep3101==1.3.0
flake8-polyfill==1.0.2
flake8-print==3.1.4
flake8-quotes==2.1.1
flake8-rst-docstrings==0.0.12
flake8-string-format==0.2.3
future==0.17.1
gitdb2==2.0.5
GitPython==2.1.11
importlib-metadata==0.18
isort==4.3.20
mando==0.6.4
mccabe==0.6.1
pbr==5.1.3
pep8-naming==0.9.1
pycodestyle==2.5.0
pydocstyle==2.1.1
pyflakes==2.1.1
Pygments==2.4.2
PyStemmer==1.3.0
PyYAML==5.1.1
radon==4.0.0
restructuredtext-lint==1.3.0
six==1.12.0
smmap2==2.0.5
snowballstemmer==1.2.1
stevedore==1.30.1
testfixtures==6.3.0
toml==0.10.0
typing-extensions==3.7.4
wemake-python-styleguide==0.13.3
zipp==0.5.1
```



Discussion:

Resolving patch:
diff --git a/wemake_python_styleguide/options/config.py b/wemake_python_styleguide/options/config.py
--- a/wemake_python_styleguide/options/config.py
+++ b/wemake_python_styleguide/options/config.py
@@ -129,7 +129,7 @@
 
 """
 
-from typing import ClassVar, FrozenSet, Mapping, Optional, Sequence, Union
+from typing import ClassVar, Mapping, Optional, Sequence, Union
 
 import attr
 from flake8.options.manager import OptionManager
@@ -137,7 +137,7 @@
 
 from wemake_python_styleguide.options import defaults
 
-ConfigValuesTypes = Union[str, int, bool, FrozenSet[str]]
+ConfigValuesTypes = Union[str, int, bool, Sequence[str]]
 
 
 @final
diff --git a/wemake_python_styleguide/options/defaults.py b/wemake_python_styleguide/options/defaults.py
--- a/wemake_python_styleguide/options/defaults.py
+++ b/wemake_python_styleguide/options/defaults.py
@@ -33,10 +33,10 @@
 MAX_NOQA_COMMENTS: Final = 10  # guessed
 
 #: List of nested classes' names we allow to use.
-NESTED_CLASSES_WHITELIST: Final = frozenset((
+NESTED_CLASSES_WHITELIST: Final = (
     'Meta',  # django forms, models, drf, etc
     'Params',  # factoryboy specific
-))
+)
 
 
 # ===========


Test patch: