summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2019-07-28 10:39:27 -0400
committerEric N. Vander Weele <ericvw@gmail.com>2019-07-28 10:43:06 -0400
commit1ba56b9056fd60dbb0f991fe5a4ac0bb6ad85cb9 (patch)
treeec59e09c49d61a785ec2b9b2ccf67c0d3395e98a /src
parenta0cd55fd6d2697f4823d1de24c9dda5858b27610 (diff)
downloadflake8-1ba56b9056fd60dbb0f991fe5a4ac0bb6ad85cb9.tar.gz
utils: Change `normalize_paths()` contract
The `normalize_paths()` utility was doing too much — parsing unstructured configuration path data and dispatching the scrubbed paths to be normalized. Towards moving the parsing of unstructured configuration path data closer towards were configuration occurs, have the utility accept only structured input for normalizing paths.
Diffstat (limited to 'src')
-rw-r--r--src/flake8/utils.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/flake8/utils.py b/src/flake8/utils.py
index bb6ba2e..5ed78e1 100644
--- a/src/flake8/utils.py
+++ b/src/flake8/utils.py
@@ -160,8 +160,8 @@ def parse_files_to_codes_mapping(value_): # noqa: C901
def normalize_paths(paths, parent=os.curdir):
- # type: (Union[Sequence[str], str], str) -> List[str]
- """Parse a comma-separated list of paths.
+ # type: (Sequence[str], str) -> List[str]
+ """Normalize a list of paths relative to a parent directory.
:returns:
The normalized paths.
@@ -169,9 +169,7 @@ def normalize_paths(paths, parent=os.curdir):
[str]
"""
assert isinstance(paths, list), paths # nosec (for bandit)
- return [
- normalize_path(p, parent) for p in parse_comma_separated_list(paths)
- ]
+ return [normalize_path(p, parent) for p in paths]
def normalize_path(path, parent=os.curdir):