Skip to content

Commit

Permalink
minor: optimize ConfigProjectSource (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored and Kuniwak committed May 19, 2018
1 parent 4403fd9 commit 28d0969
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions vint/linting/config/config_project_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
'.vintrc.yml',
'.vintrc',
]
VOID_CONFIG_PATH = get_asset_path('void_config.yaml')


class ConfigProjectSource(ConfigFileSource):
def get_file_path(self, env):
proj_conf_path = VOID_CONFIG_PATH

path_list_to_search = [Path(env['cwd'])] + list(Path(env['cwd']).parents)
cwd = Path(env['cwd'])
path_list_to_search = [cwd] + list(cwd.parents)

for project_path in path_list_to_search:
for basename in PROJECT_CONFIG_FILENAMES:
Expand All @@ -23,4 +21,4 @@ def get_file_path(self, env):
if proj_conf_path_tmp.is_file():
return proj_conf_path_tmp

return proj_conf_path
return get_asset_path('void_config.yaml')

0 comments on commit 28d0969

Please sign in to comment.