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):
1929
1929
else :
1930
1930
return None
1931
1931
1932
- def get_config_file_list (filename ):
1932
+ def get_config_file_list (start_dir ):
1933
1933
"""helper function to create list of config files found in parent directories"""
1934
1934
config_file_list = []
1935
- dir = os . path . dirname ( filename )
1935
+ dir = start_dir
1936
1936
while True :
1937
1937
config_file = os .path .join (dir , '.fprettify.rc' )
1938
1938
if os .path .isfile (config_file ):
@@ -2095,7 +2095,8 @@ def build_ws_dict(args):
2095
2095
# reparse arguments using the file's list of config files
2096
2096
filearguments = arguments
2097
2097
if argparse .__name__ == "configargparse" :
2098
- filearguments ['default_config_files' ] = ['~/.fprettify.rc' ] + get_config_file_list (os .path .abspath (filename ) if filename != '-' else os .getcwd ())
2098
+ filearguments ['default_config_files' ] = ['~/.fprettify.rc' ] \
2099
+ + get_config_file_list (os .path .dirname (os .path .abspath (filename )) if filename != '-' else os .getcwd ())
2099
2100
file_argparser = get_arg_parser (filearguments )
2100
2101
file_args = file_argparser .parse_args (argv [1 :])
2101
2102
ws_dict = build_ws_dict (file_args )
You can’t perform that action at this time.
0 commit comments