You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, µsort will automatically look for the "nearest" pyproject.toml for each file being formatted, and load the config from that location before formatting the associated file. For some projects, it would be preferable to specify the location of a canonical pyproject.toml that will be used as configuration for all files being formatted, regardless of any other pyproject.toml found near these files. This would also enable loading configs from a generic toml file, but we should always expect to find config values in the PEP-518 compliant tool.usort table.
The flag should probably be something like:
$ usort --config path/to/config.toml format ...
Normally, usort.sorting.usort_path() and usort.sorting.usort_stdin() call Config.find(...) to locate pyproject.toml and receive an appropriate Config object. A solution for this should probably set a flag or call a classmethod on Config to override that behavior and always supply the preferred configuration.
The text was updated successfully, but these errors were encountered:
@jreese I think you were going to deprecate all command line flags except for overriding config location? Do you want to reword this to match that goal?
amyreese
changed the title
Provide commandline flags to customize known modules
Add command line flag to specify location of usort config
Oct 29, 2020
amyreese
changed the title
Add command line flag to specify location of usort config
Feature: Add command line flag to specify location of usort config
Mar 4, 2022
By default, µsort will automatically look for the "nearest" pyproject.toml for each file being formatted, and load the config from that location before formatting the associated file. For some projects, it would be preferable to specify the location of a canonical pyproject.toml that will be used as configuration for all files being formatted, regardless of any other pyproject.toml found near these files. This would also enable loading configs from a generic toml file, but we should always expect to find config values in the PEP-518 compliant
tool.usort
table.The flag should probably be something like:
Normally,
usort.sorting.usort_path()
andusort.sorting.usort_stdin()
callConfig.find(...)
to locate pyproject.toml and receive an appropriate Config object. A solution for this should probably set a flag or call a classmethod on Config to override that behavior and always supply the preferred configuration.The text was updated successfully, but these errors were encountered: