sorawee / fmt

A code formatter for Racket
Other
72 stars 6 forks source link

Avoid writing file in-place when no changes #42

Closed JennToo closed 1 year ago

JennToo commented 1 year ago

One use case for this is for other tools that watch for file changes (e.g. inotifywait). Another is for tools that look at file timestamps (e.g. make). Both of these kinds of tools usually only want to do work when the file really changes.

I've only just started learning Racket, so if I've done anything weird by conventions please let me know!

I didn't spot any automated tests for the raco.rkt file to add on to, and I'm not sure I'm confident enough yet to add a new test suite. But I did test this manually using an inotify-based tool and it seems to fix the issue I was seeing.

sorawee commented 1 year ago

Thanks again!

JennToo commented 1 year ago

Sure thing! And thanks for the great tool! I find it so hard to work in programming languages that don't have formatters