Closed seanbreckenridge closed 11 months ago
tbh I'd rather not carry the complexity and you've already got a working solution
yeah, fair enough -- I only format a setup.cfg
once in a while anyways, so this is fine as a solution
after reading through the code would infect a bunch of things because of _adjacent_filename
For anyone else trying to do this, should note that you should make the setup.cfg
tempfile in the same directory as the setup.cfg
, so it can pick up readme/license changes
Was trying to set this up to autoformat my
setup.cfg
files in neovim, and the easiest way to do that (with the plugin I use) is to be able to read fromSTDIN
/write back toSTDOUT
which then replaces the contents of the buffer. I ended up just wrapping it in a script like:and that works, but would be nice to be able to avoid the tempfile.
So, proposed feature is to be able to call this with like
setup-cfg-fmt - <setup.cfg
, and it prints the formattedsetup.cfg
to stdoutIf you're ok with adding this, I can make a PR