ssort icon indicating copy to clipboard operation
ssort copied to clipboard

Add pyproject.toml / setup.py configuration

Open SerGeRybakov opened this issue 3 years ago • 3 comments

Hi! Though I use ssort in pre-commit and CI I think it will be nice to have a possibility to set up ssort configuration in default pyproject.toml / setup.py files. There one can explicitly exclude some folders or files from ssorting, set the ordering and all other other possible cli-configs. Is it possible?

SerGeRybakov avatar May 17 '22 12:05 SerGeRybakov

Hi @SerGeRybakov - Sorry for slow response. Glad to hear you are using ssort. Ordering isn't really configurable in any way at the moment, and I'm hesitant to change that. Excluding folders and files based on pyproject.toml would definitely be possible though, and something I would be glad to have in the project. At the moment we exclude based on .gitignore. I think you would probably need to extend this function to also find, parse and cache pyproject.toml files: https://github.com/bwhmather/ssort/blob/65c4b0a1f2e9e93e65855967f9a438046b24d9e1/src/ssort/_files.py#L35-L48.

A related issue is https://github.com/bwhmather/ssort/issues/62. It might make sense to also have pyproject.toml change the default behaviour when running ssort in a folder without arguments.

I'm a bit snowed under at the moment, so won't be able to implement any time soon. I'm going to mark this as good first issue. If you want to take a stab at it, I will happily review.

bwhmather avatar May 24 '22 08:05 bwhmather

I'm implementing this

cgahr avatar Apr 26 '23 10:04 cgahr

Closed by #84

cgahr avatar Apr 30 '23 12:04 cgahr