Skip to content

Commit

Permalink
Pass target file path to ufmt config factory
Browse files Browse the repository at this point in the history
This fixes `ufmt_file` to pass the full file path to the ufmt config
factory, rather than just the path's parent. This enables alternate
config factories to make decisions based on the target filename, suffix,
etc that can't be made just based on the parent path. This also aligns
with config factory usage for black and usort.

Fixes #196

ghstack-source-id: ddaee6f076eb705fa35bef5aa82c699738c3eff4
Pull Request resolved: #197
  • Loading branch information
amyreese committed Feb 28, 2024
1 parent bf5a3c6 commit 2ddb152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ufmt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def ufmt_file(
the skip exception, or ``True`` if no message is given.
"""
path = path.resolve()
ufmt_config = (ufmt_config_factory or load_config)(path.parent, root)
ufmt_config = (ufmt_config_factory or load_config)(path, root)
black_config = (black_config_factory or make_black_config)(path)
usort_config = (usort_config_factory or UsortConfig.find)(path)

Expand Down

0 comments on commit 2ddb152

Please sign in to comment.