digama0 / mmj2

mmj2 GUI Proof Assistant for the Metamath project
GNU General Public License v2.0
72 stars 25 forks source link

Eclipse IDE reformats existing code style when making changes #53

Closed billh0420 closed 3 years ago

billh0420 commented 3 years ago

I am modifying the file ProofAsstGUI.java with the Eclipse IDE. The Eclipse IDE automatically corrects code style according to the preference in Java->Code Style->Formatter setting. I modified the default setting to keep "{ }" on one line to match the current mmj2 style. However, there are still other differences: see lines 471, 1238, 1264, and 1449 where the "{" is not under "new".

Question one: Is this intentional? I prefer it under "new".

There is also a difference for line 2093. The original is:

 `
    try (final BufferedWriter w = new BufferedWriter(new FileWriter(file))){
        final String s = proofTextPane.getText();
        w.write(s, 0, s.length());
    } catch (final Throwable e) {

`

My version is:

 `
    try (
        final BufferedWriter w = new BufferedWriter(new FileWriter(file)))
    {
        final String s = proofTextPane.getText();
        w.write(s, 0, s.length());
    } catch (final Throwable e) {

`

I am not worry about this case.

Question two: Should we all be using the same IDE with the same code style settings?

Otherwise, every time someone does a push, unnecessary changes will be made due only to code style requirements.

digama0 commented 3 years ago

I would recommend turning off the formatter and/or only formatting new code. I have no interest in patches that battle with formatting settings.