X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/f3599b22d4761558032b240605f1f37ee910ba10..e4c55b48879c48bce2f3730ebb114aa2a67ab4d1:/src/black/__init__.py?ds=inline diff --git a/src/black/__init__.py b/src/black/__init__.py index a7e89cc..b32197a 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -267,7 +267,7 @@ def supports_feature(target_versions: Set[TargetVersion], feature: Feature) -> b return all(feature in VERSION_TO_FEATURES[version] for version in target_versions) -def find_pyproject_toml(path_search_start: str) -> Optional[str]: +def find_pyproject_toml(path_search_start: Iterable[str]) -> Optional[str]: """Find the absolute filepath to a pyproject.toml if it exists""" path_project_root = find_project_root(path_search_start) path_pyproject_toml = path_project_root / "pyproject.toml" @@ -281,7 +281,12 @@ def parse_pyproject_toml(path_config: str) -> Dict[str, Any]: """ pyproject_toml = toml.load(path_config) config = pyproject_toml.get("tool", {}).get("black", {}) - return {k.replace("--", "").replace("-", "_"): v for k, v in config.items()} + return { + k.replace("--", "").replace("-", "_"): str(v) + if not isinstance(v, (list, dict)) + else v + for k, v in config.items() + } def read_pyproject_toml(