Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add command line flag to specify location of usort config #31

Open
thatch opened this issue Sep 30, 2020 · 2 comments
Open

Feature: Add command line flag to specify location of usort config #31

thatch opened this issue Sep 30, 2020 · 2 comments
Labels
good first issue Good for newcomers

Comments

@thatch
Copy link
Contributor

thatch commented Sep 30, 2020

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.

@thatch thatch added the good first issue Good for newcomers label Sep 30, 2020
@thatch
Copy link
Contributor Author

thatch commented Oct 27, 2020

@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 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
Copy link
Member

Updated title and summary.

@amyreese 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants