Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 4 additions & 4 deletions isort/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,15 +1111,15 @@ def main(argv: Optional[Sequence[str]] = None, stdin: Optional[TextIOWrapper] =
all_attempt_broken = False
no_valid_encodings = False

config_trie: Optional[Trie] = None
if resolve_all_configs:
config_trie = find_all_configs(config_dict.pop("config_root", "."))

if "src_paths" in config_dict:
config_dict["src_paths"] = {
Path(src_path).resolve() for src_path in config_dict.get("src_paths", ())
}

config_trie: Optional[Trie] = None
if resolve_all_configs:
config_trie = find_all_configs(config_dict.pop("config_root", "."), config_dict)

config = Config(**config_dict)
if show_config:
print(json.dumps(config.__dict__, indent=4, separators=(",", ": "), default=_preconvert))
Expand Down
3 changes: 2 additions & 1 deletion isort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def _find_config(path: str) -> Tuple[str, Dict[str, Any]]:
return (path, {})


def find_all_configs(path: str) -> Trie:
def find_all_configs(path: str, config_overrides: Dict[str, Any]) -> Trie:
"""
Looks for config files in the path provided and in all of its sub-directories.
Parses and stores any config file encountered in a trie and returns the root of
Expand All @@ -820,6 +820,7 @@ def find_all_configs(path: str) -> Trie:
config_data = {}

if config_data:
config_data.update(config_overrides)
trie_root.insert(potential_config_file, config_data)
break

Expand Down