incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svante Schubert <svante.schub...@gmail.com>
Subject Re: Code Formatting
Date Mon, 17 Dec 2012 15:00:30 GMT
Hi Florian,

In XSLT script it makes a lot of sense to use TAB saves a lot of time
when the XML is being parsed. If I remember it well the previous coding
guidelines demanded TABs even for Java.
Honestly I do not care what we choose, but we should be consistent.

Problem areas are:

 1. Whitespace (tab vs. spaces)
 2. Line ending (Unix, Windows or Mac)
 3. Java Formatting provided by the IDEs - I use Netbeans and often use
    its Java autoformatter

The only safe consistent solution would be to do a server based
normalization of our source code, like it is being done via GIT does
with its git hooks <http://git-scm.com/book/en/Customizing-Git-Git-Hooks>.
I heard that the Libreoffice developer using this a lot.

Regarding formatting, we should consider as well to do a normalization
on the client side, so the user is able to reflect the changes (WYSIWYG).
There is a Maven Java formatter plugin
<http://maven-java-formatter-plugin.googlecode.com/svn/site/0.3.1/usage.html>
I once saw in another project, but never used myself, which might be of
help.
The plugin is even able to align local line endings - uncertain if it is
possible to be applied only on sources being changed.
Anyone experience with this and a suggestion how to proceed?
Shall we do a normalization of all source in the end?

State of the art for Java in cross platform programming is from my
observation Unix line-ending, more often "spaces" than "taps", but
unfortunately no interoperability for cross IDE Java formatting.

PS: Sorry for the belayed response (pre-x-mas-stress-syndrom)

Best regards,
Svante

On 14.12.2012 08:40, Florian Hopf wrote:
> Hi,
>
> I noticed that my default formatting rules don't comply with most of
> the sources that I am touching. It seems that the indentation is two
> tabs whereas I normally use 4 spaces instead of tabs. Are there any
> accepted formatting rules for the project available?
>
> Regards
> Florian
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message