Skip to content

Commit

Permalink
feat: allow pyproject.toml to be located in root dir's parents (thanks
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-k authored and andreoliwa committed Mar 19, 2019
1 parent 5e43c46 commit d3c4d74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions flake8_nitpick/config.py
Expand Up @@ -99,10 +99,11 @@ def clear_cache_dir(self) -> None:

def merge_styles(self) -> YieldFlake8Error:
"""Merge one or multiple style files."""
pyproject_path: Path = self.root_dir / PyProjectTomlFile.file_name
if pyproject_path.exists():
self.pyproject_dict: JsonDict = toml.load(str(pyproject_path))
self.tool_nitpick_dict: JsonDict = search_dict(TOOL_NITPICK_JMEX, self.pyproject_dict, {})
if self.root_dir:
pyproject_paths = climb_directory_tree(self.root_dir, file_patterns=[PyProjectTomlFile.file_name])
if pyproject_paths:
self.pyproject_dict: JsonDict = toml.load(str(pyproject_paths[0]))
self.tool_nitpick_dict: JsonDict = search_dict(TOOL_NITPICK_JMEX, self.pyproject_dict, {})

configured_styles: StrOrList = self.tool_nitpick_dict.get("style", "")
style = Style(self)
Expand Down

0 comments on commit d3c4d74

Please sign in to comment.