Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert (most of the) configuration values from pyproject.toml to strings #1466

Merged
merged 3 commits into from
Jun 1, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import asyncio
from abc import ABC, abstractmethod
from collections import defaultdict
import collections.abc
from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor
from contextlib import contextmanager
from datetime import datetime
Expand Down Expand Up @@ -316,7 +317,12 @@ def read_pyproject_toml(
default_map: Dict[str, Any] = {}
if ctx.default_map:
default_map.update(ctx.default_map)
default_map.update(config)
default_map.update(
{
k: str(v) if not isinstance(v, collections.abc.Iterable) else v
for k, v in config.items()
}
)

ctx.default_map = default_map
return value
Expand Down