Code formatting in Eclipse gone mad

As we all know, we need to use standard formatting for team code development.

Hence Jalview is configured with:

  • use project specific code formatting, imported from utils/eclipse/JalviewCodeStyle.xml

  • Editor Save Action: formatted edited lines (only), plus a few additional save actions

These settings are in two metadata files under .settings in the workspace.

I have recently had the problem that the Jalview formatter seems to be ignored, and the Eclipse default applied instead.

For example, if I edit and save these lines

public void closePanel()

{

I get

public void closePanel() {

which corresponds to the Eclipse default, not the Jalview formatter.

The University of Dundee is a registered Scottish Charity, No: SC015096

···

This looks like a long standing bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360711

I will explore whether reimporting the code style from XML resolves this.
Has anyone else had the same problem?

thanks,

mungo
Email signature

University of Dundee shield logo

Mungo Carstairs
Jalview Computational Scientist

The Barton Group
Division of Computational Biology

School of Life Sciences

University of Dundee, Dundee, Scotland, UK

www.jalview.org

www.compbio.dundee.ac.uk
g.m.carstairs@dundee.ac.uk

University of Dundee FacebookUniversity of Dundee TwitterUniversity of Dundee LinkedInUniversity of Dundee YouTubeUniversity of Dundee InstagramUniversity of Dundee Snapchat
We’re Scottish University of the Year again!
The Times / Sunday Times Good University Guide 2016 and 2017

Hi Mungo

As we all know, we need to use standard formatting for team code development.

Hence Jalview is configured with:

  • use project specific code formatting, imported from utils/eclipse/JalviewCodeStyle.xml

  • Editor Save Action: formatted edited lines (only), plus a few additional save actions

These settings are in two metadata files under .settings in the workspace.

I have recently had the problem that the Jalview formatter seems to be ignored, and the Eclipse default applied instead.

For example, if I edit and save these lines

public void closePanel()

{

I get

public void closePanel() {

which corresponds to the Eclipse default, not the Jalview formatter.

This looks like a long standing bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360711

I will explore whether reimporting the code style from XML resolves this.
Has anyone else had the same problem?

Not as yet. Are there commits where this has happened ? they should be fixed immediately - no tabs allowed. period.

The University of Dundee is a registered Scottish Charity, No: SC015096

···

On 21/11/2018 16:14, Mungo Carstairs (Staff) wrote:

I have not. But that is the default that I use on other projects, so I probably don’t notice it there. I’m generally very careful not to press ALT-S-F (full file formatting) and have tried to be respectful of the Jalview style. Let me know if was files I touched. I had to turn auto-formatting off on my implementation because it was forever forcing rebuilding of the project, and with Java2Script working, that is a total drag. So for the one recent fix I made in the code - JSTableUI.buildTable$(), I think - I don’t think I did any formatting.

Bob

···

Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want,
it is better to take what answer we get.

– Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900