Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stardust-dev] Fwd: Ensuring consistent formatting (breaks, spacing, tabs vs. spaces, ...)

Hi Oliver,

in fact we have an inconsistent state at the moment although we're providing formatter rules for the Java and JavaScript editor [1]. Some of the Stardust committer are also using AnyEdit but for removing trailing whitespaces. Unfortunately this is also not heeded by some committers. So your suggestion to use Checkstyle makes perfectly sense. I've also thought about it but unfortunately I had no time to introduce it because this task is not so easy at it looks like. For instance some source code like AdministrationServiceImpl is generated by a tool (which must be triggered manually) as soon the AdministrationService is modified. Nevertheless we should take the time to introduce a homogenous code style. I'll clarify this and come back to you as soon as I have more information if and when we'll introduce Checkstyle.

BTW: here're some important coding conventions:
* Use spaces instead tabs
* Indentation size: 3
* Angle brackets should be set in a new line
* Line size: 90
* Text files should use UTF-8 encoding

[1] http://git.eclipse.org/c/stardust/org.eclipse.stardust.build.tools.git/tree/conf/eclipse

--
Sven

-----Ursprüngliche Nachricht-----
Von: stardust-dev-bounces@xxxxxxxxxxx [mailto:stardust-dev-bounces@xxxxxxxxxxx] Im Auftrag von Oliver Kopp
Gesendet: Dienstag, 7. Januar 2014 10:03
An: stardust-dev@xxxxxxxxxxx
Betreff: [stardust-dev] Fwd: Ensuring consistent formatting (breaks, spacing, tabs vs. spaces, ...)

Hey,

(resend because the last mail went to the -request address instead of the real list)

Whoever ported tabs to the electronic world should feel guilty.
Nevertheless, tabs are there. And some committers use tabs, some don't. :)

In Winery, we distribute formatter templates and settings for "Java / Editor / Save Actions".
There seems, however, no setting for space2tab conversion.

In Winery, we use the [AnyEdit tools] and distribute `.settings/de.loskutov.anyedit.AnyEditTools.prefs` in the directories of each Eclipse project. And we always use tabs. O:)

What do you do? How do you ensure that the code is consistently formatted?

[Stackoverflow] recommends using Checkstyle both in Eclipse and in the Maven builds An interesting idea is to [use the Eclipse code formatter in a command line]. There is even a maven plugin for that:
https://code.google.com/p/maven-java-formatter-plugin/. [Apache CXF] configures the workspace automatically using some magic :)

Cheers,

Oliver

  [AnyEdit tools]: http://andrei.gmxhome.de/anyedit/index.html
  [Stackoverflow]:
http://stackoverflow.com/questions/1955514/best-practices-for-code-formatting-on-large-projects
  [use the Eclipse code formatter in a command line]:
http://www.peterfriese.de/formatting-your-code-using-the-eclipse-code-formatter/
  [Apache CXF]:
http://cxf.apache.org/connecting-maven-eclipse-checkstyle-and-pmd.html
_______________________________________________
stardust-dev mailing list
stardust-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/stardust-dev




Back to the top