File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1929,10 +1929,10 @@ def str2bool(str):
19291929 else :
19301930 return None
19311931
1932- def get_config_file_list (filename ):
1932+ def get_config_file_list (start_dir ):
19331933 """helper function to create list of config files found in parent directories"""
19341934 config_file_list = []
1935- dir = os . path . dirname ( filename )
1935+ dir = start_dir
19361936 while True :
19371937 config_file = os .path .join (dir , '.fprettify.rc' )
19381938 if os .path .isfile (config_file ):
@@ -2096,7 +2096,8 @@ def build_ws_dict(args):
20962096 # reparse arguments using the file's list of config files
20972097 filearguments = arguments
20982098 if argparse .__name__ == "configargparse" :
2099- filearguments ['default_config_files' ] = ['~/.fprettify.rc' ] + get_config_file_list (os .path .abspath (filename ) if filename != '-' else os .getcwd ())
2099+ filearguments ['default_config_files' ] = ['~/.fprettify.rc' ] \
2100+ + get_config_file_list (os .path .dirname (os .path .abspath (filename )) if filename != '-' else os .getcwd ())
21002101 file_argparser = get_arg_parser (filearguments )
21012102 file_args = file_argparser .parse_args (argv [1 :])
21022103
You can’t perform that action at this time.
0 commit comments