tox-dev / pyproject-fmt

MIT License
167 stars 27 forks source link

Add API #216

Closed gaborbernat closed 4 months ago

gaborbernat commented 4 months ago

👍

gaborbernat commented 4 months ago

@abravalheri can you confirm this is good enough for you? Can't give sadly pass in string functionality, but this should be close enough.

abravalheri commented 4 months ago

Thank you very much for having a go at this.

I suppose that the next best thing for applications that want to manipulate in-memory strings directly would be to use pyproject-fmt-rust and copy the defaults from pyproject-fmt, right?

There is the obvious drawback that the pyproject-fmt defaults might drift with time (and/or) new configuration options may be added, so the application would have to catch up, but at least that would eliminate the need for temporary files...

gaborbernat commented 4 months ago

Thank you very much for having a go at this.

I suppose that the next best thing for applications that want to manipulate in-memory strings directly would be to use pyproject-fmt-rust and copy the defaults from pyproject-fmt, right?

There is the obvious drawback that the pyproject-fmt defaults might drift with time (and/or) new configuration options may be added, so the application would have to catch up, but at least that would eliminate the need for temporary files...

Sure, but note the settings class is not backwards compatible so you'll need to pin the project. 😅