You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Michael Dick (JIRA)" <ji...@apache.org> on 2008/12/18 21:23:44 UTC
[jira] Created: (OPENJPA-832) Add eclipse formatting preferences to
website
Add eclipse formatting preferences to website
---------------------------------------------
Key: OPENJPA-832
URL: https://issues.apache.org/jira/browse/OPENJPA-832
Project: OpenJPA
Issue Type: Sub-task
Components: build / infrastructure
Reporter: Michael Dick
Priority: Minor
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709070#action_12709070 ]
Milosz Tylenda commented on OPENJPA-832:
----------------------------------------
To the wiki page I have added a few verbal descriptions of formatting rules for non-Eclipse users. This is by no means an exhaustive list, rather a starting point, and can be furhter extended. A sample formatted source file could also be added or linked from Subversion.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: force-split.png, openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709064#action_12709064 ]
Michael Dick commented on OPENJPA-832:
--------------------------------------
Re #3, thanks for the screenshot. I missed the checkbox at the bottom (kind of obvious now though). I'd say that's a personal style issue. I prefer not to force the split, but I wouldn't reject a patch over it :-)
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: force-split.png, openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708588#action_12708588 ]
Donald Woods commented on OPENJPA-832:
--------------------------------------
The formatter and template files are what most of the IBMers on the project are using (existed before I started working on OpenJPA...)
Not sure about the if/else settings, as we have source code that uses both styles and I personally prefer always using braces.
I've had terrible luck with the Eclipse source formatter, with usually several lines in a source file not being split to <=80 or having weird line splitting no matter what options I set.
Any tweaks to the XML files are welcome. Thanks.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708559#action_12708559 ]
Milosz Tylenda commented on OPENJPA-832:
----------------------------------------
Good job, Donald.
1. Have you managed to force Eclipse formatter to remove braces from one-line "if/else" statements? I couldn't achieve this but maybe it's possible with newer Eclipse versions (I use 3.2.2).
2. I noticed the formatter file on Wiki contains a few settings related to compiler? Is this intentional?
3. Maybe the formatter could have set to true the value "Force split" in Line Wrapping -> Class Declarations (and maybe some others too). I am not saying it's good or bad but seems to be consistent with the current formatting.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-832) Add eclipse formatting preferences to
website
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Dick updated OPENJPA-832:
---------------------------------
Attachment: openjpa-formatter.xml
Attaching openjpa-formatter.xml originally attached to parent issue (OPENJPA-779) by Milosz Tylenda. Attachement was originally granted license to ASF for inclusion.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Donald Woods reassigned OPENJPA-832:
------------------------------------
Assignee: Donald Woods
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657884#action_12657884 ]
Michael Dick commented on OPENJPA-832:
--------------------------------------
Creating a sub issue for handling the formatter. Milosz contributed his settings to the parent issue, but I think this warrants a topic of its own so that it's documented properly.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Priority: Minor
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708625#action_12708625 ]
Michael Dick commented on OPENJPA-832:
--------------------------------------
Hi Milosz,
1. Curly braces for one line if/else statements are intentional - if we're following the Sun Java code conventions. It isn't widely used throughout the code though - I believe the original code drop used a different set of conventions and we've never cleaned them up.
FWIW I clean them up when I see them in code I'm changing.
2. I think I'm the original owner of the formatting preferences (not trying to steal credit - they just match my settings - could have been someone else). If so the compiler settings are an oversight, I just exported my config and sent it around after a cursory glance at the contents.
3. I've only used the GUI to generate the config, so I'm not sure what you mean. The GUI claims it only wraps when necessary.
Donald,
You're not alone. The eclipse formatter doesn't seem to work perfectly for me either - seems to ignore it if just a curly brace goes past 80 chars, and some other miscellaneous problems (maybe #3).
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709033#action_12709033 ]
Milosz Tylenda commented on OPENJPA-832:
----------------------------------------
Hi Mike,
1. OK, now it's clear - braces ARE recommended regardless of number of lines in if/else.
3. I have attached an image with the mentioned option checked. It is a minor issue anyways.
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: force-split.png, openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (OPENJPA-832) Add eclipse formatting preferences
to website
Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Donald Woods resolved OPENJPA-832.
----------------------------------
Resolution: Fixed
Files added to the wiki on April 28, 2009 - http://cwiki.apache.org/openjpa/coding-standards.html
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-832) Add eclipse formatting preferences to
website
Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Milosz Tylenda updated OPENJPA-832:
-----------------------------------
Attachment: force-split.png
> Add eclipse formatting preferences to website
> ---------------------------------------------
>
> Key: OPENJPA-832
> URL: https://issues.apache.org/jira/browse/OPENJPA-832
> Project: OpenJPA
> Issue Type: Sub-task
> Components: build / infrastructure
> Reporter: Michael Dick
> Assignee: Donald Woods
> Priority: Minor
> Attachments: force-split.png, openjpa-formatter.xml
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.