Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Is it possible to turn off autoformatting? #300
I'm not looking to turn off formatting for everyone all the time. But for us, it would be great if we could turn it off when we need to.
Hmm, I dunno. That might help for that one rule, but it doesn't sound it would fix that one rule. Instead of the rule firing each run, it would fire at most two times each time
Taking a step back, it's a bit unexpected that
Again, not looking to change the default for everyone. We've already worked around this issue, so it's not a make or break thing. But, it would simplify our build system if we could pass in a flag instead of altering our rules.
@LiamGoodacre: upon further investigation I realized that the "autoformatting" is happening because we're trying to migrate old configs without checking if they are using the old schema - this is effectively idempotent except it reformats the file
So I think we should get rid of the flag and just write the file if it's effectively needed (that is, Spago doesn't want to reformat your files, but it will need to in some cases, and we cannot have a flag to shut this behaviour of it's needed to proceed)
However before doing this I'm waiting on #301, as that's shuffling some very relevant code
@joneshf yes, this is what will happen after 1.0: we'll either not change the config format or just read the files in old config formats
However while we are in "pre-1.0" I'd like to migrate config files to the newest version as much as we can, so we can deprecate old config formats (and the migration logic itself) and have our "breaking config changes" not be distruptive for users
I think this is fine because "configuration migration" is a one-off write, so it's not disruptive for build systems etc (the bug here is that we're writing the file every time anyways)
If you're curious about all behaviours that will change in 1.0, see #291 (which already contains "stop migrating configs")