File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,12 +166,12 @@ def setup_arg_parser():
166166 return args
167167
168168
169- def load_config (args ) -> dict :
170- if args . config :
171- return tomllib .load (args . config )
169+ def load_config (config : dict , targets : list [ str ] ) -> dict :
170+ if config :
171+ return tomllib .load (config )
172172 else :
173173 default_confs = (".precli.toml" , "precli.toml" , "pyproject.toml" )
174- for target in filter (os .path .isdir , args . targets ):
174+ for target in filter (os .path .isdir , targets ):
175175 for conf in default_confs :
176176 path = pathlib .Path (target ) / conf
177177 if path .exists ():
@@ -367,7 +367,7 @@ def main():
367367 args = setup_arg_parser ()
368368
369369 # Load optional configuration file
370- config = load_config (args )
370+ config = load_config (args . config , args . targets )
371371
372372 # CLI enabled/disabled override any config in files
373373 config ["enabled" ] = (
You can’t perform that action at this time.
0 commit comments