flake8/src
Eric N. Vander Weele f01011a403 Normalize option values additionally by type
Now that the contract has narrowed for `utils.normalize_paths()`
and `utils.parse_comma_separated_list()`, `Option.normalize()` must
handle when the option value is either a singular value or a sequence
(i.e., `list`) of values.

The paths where `Option.normalize()` is called are:

1. options/config.py: `MergedConfigParser.parse_*_config()`
    There are 3 paths wehre eventually `_normalize_value()` is called.
2. options/manager.py: `OptionManager.parse_args()`

For (1), values are coming from the `configparser` module.  For (2),
values are coming from `optparse.OptionParser`.

Rudimentary investigation seems to implicate that
`optparse.OptionParser.parse_args()` always returns values in a `list`
because it accumulates values.  However, for `configparser`, the values
are a string due to the key-value nature of the INI format.

Given that `Option.normalize()` is the convergence point where
normalization of an option occurs, it is acceptable for the method to
also handle the parsing comma-separated values and path normalization by
the option value's type.
2019-07-28 10:43:06 -04:00
..
flake8 Normalize option values additionally by type 2019-07-28 10:43:06 -04:00