Apply one format on open and another format on save in IDE?
Posted: Thu Oct 10, 2013 1:29 am
I've been googling like a lunatic, and am amazed I haven't found any clear solutions to this problem (I expected to find a dozen or more options)...
I am a minority in my new development team regarding (strongly) preferred formatting style, but don't desire nor feel it fair to impose my personal preferences on others -- as well as muck up all the diffs with irrelevant lexical changes.
Also, a number of the veteran developers on the team do not yet use IDEs so the "everybody define in your IDE the style you like and always apply it locally" approach doesn't work -- and still results in "noisy" diffs if you do that anyway. Fortunately, the text editor crowd is pretty good about conforming to the team standard, so at least there's that.
So I've been looking for some form of plugin or other utility, or feature built in to an IDE, which allows me to apply one format when opening a file (or bound to some hot-key combination) and apply another format when saving the file (or bound to another hot-key combination).
This will allow me to edit/create code in my preferred style, but then shift back to the team style before final testing and commit.
This is important enough that I'd even be willing to change IDEs (I have mostly used Eclipse, but have recently started using Netbeans, FWIW) but I failed to find any plugins for either which would do this. At least with Eclipse, I could go into the settings and select an explicit formatter, and with Netbeans I can import specific formatter settings, so a worst case scenario is changing my config before new tasks and then again before final testing and commit, but what a pain.
Any suggestions?! I can't believe this isn't a common enough problem that there aren't lots of solutions to it -- but the evidence suggests otherwise...
My ideal solution would be finding a Netbeans plugin which allows me to apply or switch between different formatters or formatting styles, either bound to open and save operations, or bound to hot-keys, or similar.
HELP!
I am a minority in my new development team regarding (strongly) preferred formatting style, but don't desire nor feel it fair to impose my personal preferences on others -- as well as muck up all the diffs with irrelevant lexical changes.
Also, a number of the veteran developers on the team do not yet use IDEs so the "everybody define in your IDE the style you like and always apply it locally" approach doesn't work -- and still results in "noisy" diffs if you do that anyway. Fortunately, the text editor crowd is pretty good about conforming to the team standard, so at least there's that.
So I've been looking for some form of plugin or other utility, or feature built in to an IDE, which allows me to apply one format when opening a file (or bound to some hot-key combination) and apply another format when saving the file (or bound to another hot-key combination).
This will allow me to edit/create code in my preferred style, but then shift back to the team style before final testing and commit.
This is important enough that I'd even be willing to change IDEs (I have mostly used Eclipse, but have recently started using Netbeans, FWIW) but I failed to find any plugins for either which would do this. At least with Eclipse, I could go into the settings and select an explicit formatter, and with Netbeans I can import specific formatter settings, so a worst case scenario is changing my config before new tasks and then again before final testing and commit, but what a pain.
Any suggestions?! I can't believe this isn't a common enough problem that there aren't lots of solutions to it -- but the evidence suggests otherwise...
My ideal solution would be finding a Netbeans plugin which allows me to apply or switch between different formatters or formatting styles, either bound to open and save operations, or bound to hot-keys, or similar.
HELP!