You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2008/03/13 00:34:36 UTC

[PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

IIUC we have a coding standard of a 4 space indent for all files  
(documented at http://cwiki.apache.org/GMOxDEV/coding- 
standards.html).  This can make working with maven difficult because  
its files and xml output generatiion use 2 space indent for xml  
and .vm files.

I think we could make life a lot easier when using maven tooling to  
use a 2 space indent for xml and .vm and possibly other files.  At  
least with IDEA its easy to have different indents for java and xml  
files.

Comments?

thanks
david jencks


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
+1

to anything that makes life easier :)

++Vamsi

On Thu, Mar 13, 2008 at 5:04 AM, David Jencks <da...@yahoo.com>
wrote:

> IIUC we have a coding standard of a 4 space indent for all files
> (documented at http://cwiki.apache.org/GMOxDEV/coding-
> standards.html).  This can make working with maven difficult because
> its files and xml output generatiion use 2 space indent for xml
> and .vm files.
>
> I think we could make life a lot easier when using maven tooling to
> use a 2 space indent for xml and .vm and possibly other files.  At
> least with IDEA its easy to have different indents for java and xml
> files.
>
> Comments?
>
> thanks
> david jencks
>
>

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Jason Warner <ja...@gmail.com>.
I'm sitting here trying to think of some reason to not do this, but I can't
come up with one.  I'm all for it unless someone can come up with a reason
not to.

+1

On Wed, Mar 12, 2008 at 8:32 PM, David Jencks <da...@yahoo.com>
wrote:

>
> On Mar 12, 2008, at 5:23 PM, Jason Warner wrote:
>
> Do we know the reasoning for setting it to 4 spaces in the first place?
> Was it just arbitrary based on what we were doing for other files?
>
>
> that's my (faint) recollection.
>
> #mutters hobgoblins, small minds, etc etc
>
> thanks
> david jencks
>
>
>
>
>
> On Wed, Mar 12, 2008 at 7:34 PM, David Jencks <da...@yahoo.com>
> wrote:
>
> > IIUC we have a coding standard of a 4 space indent for all files
> > (documented at http://cwiki.apache.org/GMOxDEV/coding-
> > standards.html).  This can make working with maven difficult because
> > its files and xml output generatiion use 2 space indent for xml
> > and .vm files.
> >
> > I think we could make life a lot easier when using maven tooling to
> > use a 2 space indent for xml and .vm and possibly other files.  At
> > least with IDEA its easy to have different indents for java and xml
> > files.
> >
> > Comments?
> >
> > thanks
> > david jencks
> >
> >
>
>
> --
> ~Jason Warner
>
>
>


-- 
~Jason Warner

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by David Jencks <da...@yahoo.com>.
On Mar 12, 2008, at 5:23 PM, Jason Warner wrote:

> Do we know the reasoning for setting it to 4 spaces in the first  
> place?  Was it just arbitrary based on what we were doing for other  
> files?

that's my (faint) recollection.

#mutters hobgoblins, small minds, etc etc

thanks
david jencks
>
>
>
>
> On Wed, Mar 12, 2008 at 7:34 PM, David Jencks  
> <da...@yahoo.com> wrote:
> IIUC we have a coding standard of a 4 space indent for all files
> (documented at http://cwiki.apache.org/GMOxDEV/coding-
> standards.html).  This can make working with maven difficult because
> its files and xml output generatiion use 2 space indent for xml
> and .vm files.
>
> I think we could make life a lot easier when using maven tooling to
> use a 2 space indent for xml and .vm and possibly other files.  At
> least with IDEA its easy to have different indents for java and xml
> files.
>
> Comments?
>
> thanks
> david jencks
>
>
>
>
> -- 
> ~Jason Warner


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Jason Warner <ja...@gmail.com>.
Do we know the reasoning for setting it to 4 spaces in the first place?  Was
it just arbitrary based on what we were doing for other files?



On Wed, Mar 12, 2008 at 7:34 PM, David Jencks <da...@yahoo.com>
wrote:

> IIUC we have a coding standard of a 4 space indent for all files
> (documented at http://cwiki.apache.org/GMOxDEV/coding-
> standards.html).  This can make working with maven difficult because
> its files and xml output generatiion use 2 space indent for xml
> and .vm files.
>
> I think we could make life a lot easier when using maven tooling to
> use a 2 space indent for xml and .vm and possibly other files.  At
> least with IDEA its easy to have different indents for java and xml
> files.
>
> Comments?
>
> thanks
> david jencks
>
>


-- 
~Jason Warner

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Joe Bohn <jo...@earthlink.net>.
+1 assuming we are not forcing everything to a 2 space indent.

Joe


David Jencks wrote:
> IIUC we have a coding standard of a 4 space indent for all files 
> (documented at http://cwiki.apache.org/GMOxDEV/coding-standards.html).  
> This can make working with maven difficult because its files and xml 
> output generatiion use 2 space indent for xml and .vm files.
> 
> I think we could make life a lot easier when using maven tooling to use 
> a 2 space indent for xml and .vm and possibly other files.  At least 
> with IDEA its easy to have different indents for java and xml files.
> 
> Comments?
> 
> thanks
> david jencks
> 
> 


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Donald Woods <dw...@apache.org>.
+1 to only changing the .xml and .vm indents to 2 spaces.

-Donald

Donald Woods wrote:
> +1
> 
> 
> -Donald
> 
> David Jencks wrote:
>> IIUC we have a coding standard of a 4 space indent for all files 
>> (documented at 
>> http://cwiki.apache.org/GMOxDEV/coding-standards.html).  This can make 
>> working with maven difficult because its files and xml output 
>> generatiion use 2 space indent for xml and .vm files.
>>
>> I think we could make life a lot easier when using maven tooling to 
>> use a 2 space indent for xml and .vm and possibly other files.  At 
>> least with IDEA its easy to have different indents for java and xml 
>> files.
>>
>> Comments?
>>
>> thanks
>> david jencks
>>
>>

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Donald Woods <dw...@apache.org>.
+1


-Donald

David Jencks wrote:
> IIUC we have a coding standard of a 4 space indent for all files 
> (documented at http://cwiki.apache.org/GMOxDEV/coding-standards.html).  
> This can make working with maven difficult because its files and xml 
> output generatiion use 2 space indent for xml and .vm files.
> 
> I think we could make life a lot easier when using maven tooling to use 
> a 2 space indent for xml and .vm and possibly other files.  At least 
> with IDEA its easy to have different indents for java and xml files.
> 
> Comments?
> 
> thanks
> david jencks
> 
> 

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Kevan Miller <ke...@gmail.com>.
On Mar 12, 2008, at 7:34 PM, David Jencks wrote:

> IIUC we have a coding standard of a 4 space indent for all files  
> (documented at http://cwiki.apache.org/GMOxDEV/coding- 
> standards.html).  This can make working with maven difficult because  
> its files and xml output generatiion use 2 space indent for xml  
> and .vm files.
>
> I think we could make life a lot easier when using maven tooling to  
> use a 2 space indent for xml and .vm and possibly other files.  At  
> least with IDEA its easy to have different indents for java and xml  
> files.
>
> Comments?

K. So, you're proposing that either 2 or 4 space indent is acceptable  
for xml and .vm files? Or are you proposing that we'll update the  
indent in all existing files to be 2 space?

Is this what you're proposing?

"Either 2 or 4 space indent may be used for .xml and .vm files. 2- 
space indenting is preferred because that is the style generated by  
maven. When editing an existing file, either follow the convention  
already used in that file or convert it to use 2-space indent"

--kevan

Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Jason Dillon <ja...@planet57.com>.
On Mar 14, 2008, at 2:04 PM, David Jencks wrote:
> On Mar 13, 2008, at 10:49 PM, Jason Dillon wrote:
>
>> On Mar 14, 2008, at 8:39 AM, Alan D. Cabrera wrote:
>>> -0
>>>
>>> I find 2 space indenting difficult to read.
>>
>> This is one reason why I'm -1.
>
> I do too, but after dealing with trying to compare our files to  
> maven 2 space indented files I consider that an infinitesimal price  
> to pay for the enormous advantage of consistence with the model  
> build system.
>
>>
>>
>>>> - in genesis geronimo-skin we have a site.vm file that is a  
>>>> slightly modified copy of the default .vm file from doxia- 
>>>> sitetools.  Trying to update it or compare it with different  
>>>> indents is quite an experience.
>>
>> I made many modifications to the site.vm, so I don't really  
>> understand why anyone would want to diff it to the original.
>
> maybe to find out what you changed?  I could detect only one change,  
> which i don't understand the reason for -- adding a table to the  
> menu column.  What does that do?
>
> When I tried working on it to generate a couple sites, it didn't  
> seem to be working as well as the default skin, so to try to  
> investigate I compared it to the default.  The only difference I  
> could find was the table, so I reverted the other parts to copy the  
> default so the next person to encounter this particular hell  
> wouldn't have so much work to do.
>
> Having a copy is bad enough without reformatting it so its really  
> hard to tell how it was changed.

The site.vm was working fine... until you went and started changing  
things :-P  I made several changes so that the generated sites looked  
like the geronimo site.

Its a custom skin and IMO should not need to be compared to the  
default skin at all.  I just based our skin on the default skin, thats  
it.

>> IMO changing our XML indent from 4 to 2 spaces just because Maven  
>> uses a 2 space indent is not a hot idea... and I'm still a strong  
>> -1 on the matter.
>
> How do you reliably do a diff between 4 and 2 space indented files  
> and get a real result of actual non-whitespace differences?  Emacs  
> doesn't work, it usually flakes out halfway through the file for no  
> reason I can discern.  How do you do this without spending hours  
> finding the right tooling every time you need to do it?

I don't generally need to diff files of this nature... and I'm still  
confused why you are trying to do it.  I understand that something  
changed and now its broke.  So I suggest reverting your changes, or re- 
crafting the site.vm from the default so that it looks & behaves the  
same.  If you want to leave that file 2 space indent I don't care, but  
thats no reason to change everything to 2 spaces.

--jason



Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by David Jencks <da...@yahoo.com>.
On Mar 13, 2008, at 10:49 PM, Jason Dillon wrote:

> On Mar 14, 2008, at 8:39 AM, Alan D. Cabrera wrote:
>> -0
>>
>> I find 2 space indenting difficult to read.
>
> This is one reason why I'm -1.

I do too, but after dealing with trying to compare our files to maven  
2 space indented files I consider that an infinitesimal price to pay  
for the enormous advantage of consistence with the model build system.

>
>
>>> - in genesis geronimo-skin we have a site.vm file that is a  
>>> slightly modified copy of the default .vm file from doxia- 
>>> sitetools.  Trying to update it or compare it with different  
>>> indents is quite an experience.
>
> I made many modifications to the site.vm, so I don't really  
> understand why anyone would want to diff it to the original.

maybe to find out what you changed?  I could detect only one change,  
which i don't understand the reason for -- adding a table to the menu  
column.  What does that do?

When I tried working on it to generate a couple sites, it didn't seem  
to be working as well as the default skin, so to try to investigate I  
compared it to the default.  The only difference I could find was the  
table, so I reverted the other parts to copy the default so the next  
person to encounter this particular hell wouldn't have so much work  
to do.

Having a copy is bad enough without reformatting it so its really  
hard to tell how it was changed.

>
>
>> I'm not terribly familiar w/ site generation.  I was under the  
>> impression that we leave cookies by the wiki and elves make it.  :)
>>
>> Could we not just reformat the site.vm file to have 4 space indents?
>
> Well that is what I did... but David is trying to diff it against  
> the original ste.vm for some reason, which comes from Maven and is  
> 2 space indented.

because it didn't appear to be working right and I was trying to find  
out how it was different from the default as a clue about why.
>
>
>>> - maven archetypes pop out xml with 2 space indenting, and maven  
>>> xml has 2 space indenting.  Re-indenting our stuff any time you  
>>> run an archetype or borrow some configuration from maven is a  
>>> nuisance that frequently is ignored and again the spacing  
>>> difference makes comparison quite difficult.
>>
>> For those of us sensible enough to use IntelliJ, alt-cmd-L makes  
>> our world tidy.  Maybe we could get the archetype generator to  
>> take the number of spaces for an indent as a configuration parameter?
>
> IMO the archetype plugin needs to have this... as I know many folks  
> that don't care for 2 space indented xmls.  If needed though we can  
> whip up a reindenter in groovy quite easily.

I'm not sure us making maven more complicated is a long-term solution  
to this problem.  There are plenty of problems with the archetype  
plugin, I'm not sure making modello generated xml output pretty  
printed is one of the more pressing.
>
> * * *
>
> IMO changing our XML indent from 4 to 2 spaces just because Maven  
> uses a 2 space indent is not a hot idea... and I'm still a strong  
> -1 on the matter.

How do you reliably do a diff between 4 and 2 space indented files  
and get a real result of actual non-whitespace differences?  Emacs  
doesn't work, it usually flakes out halfway through the file for no  
reason I can discern.  How do you do this without spending hours  
finding the right tooling every time you need to do it?

thanks
david jencks

>
> --jason
>


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Jason Dillon <ja...@planet57.com>.
On Mar 14, 2008, at 8:39 AM, Alan D. Cabrera wrote:
> -0
>
> I find 2 space indenting difficult to read.

This is one reason why I'm -1.


>> - in genesis geronimo-skin we have a site.vm file that is a  
>> slightly modified copy of the default .vm file from doxia- 
>> sitetools.  Trying to update it or compare it with different  
>> indents is quite an experience.

I made many modifications to the site.vm, so I don't really understand  
why anyone would want to diff it to the original.


> I'm not terribly familiar w/ site generation.  I was under the  
> impression that we leave cookies by the wiki and elves make it.  :)
>
> Could we not just reformat the site.vm file to have 4 space indents?

Well that is what I did... but David is trying to diff it against the  
original ste.vm for some reason, which comes from Maven and is 2 space  
indented.


>> - maven archetypes pop out xml with 2 space indenting, and maven  
>> xml has 2 space indenting.  Re-indenting our stuff any time you run  
>> an archetype or borrow some configuration from maven is a nuisance  
>> that frequently is ignored and again the spacing difference makes  
>> comparison quite difficult.
>
> For those of us sensible enough to use IntelliJ, alt-cmd-L makes our  
> world tidy.  Maybe we could get the archetype generator to take the  
> number of spaces for an indent as a configuration parameter?

IMO the archetype plugin needs to have this... as I know many folks  
that don't care for 2 space indented xmls.  If needed though we can  
whip up a reindenter in groovy quite easily.

* * *

IMO changing our XML indent from 4 to 2 spaces just because Maven uses  
a 2 space indent is not a hot idea... and I'm still a strong -1 on the  
matter.

--jason


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
-0

I find 2 space indenting difficult to read.  I'm sure that I'm  
misunderstanding something so take my reply with a grain of salt.

On Mar 13, 2008, at 8:28 AM, David Jencks wrote:

>
> On Mar 13, 2008, at 7:21 AM, Jason Dillon wrote:
>
>> -1.  I don't think there is any value in making the indent for xml  
>> or any other files different than the normal indent for all other  
>> files.
>
> Let me give a couple of examples where the 4-space indent causes a  
> lot of pain and will continue to:
>
> - in genesis geronimo-skin we have a site.vm file that is a slightly  
> modified copy of the default .vm file from doxia-sitetools.  Trying  
> to update it or compare it with different indents is quite an  
> experience.

I'm not terribly familiar w/ site generation.  I was under the  
impression that we leave cookies by the wiki and elves make it.  :)

Could we not just reformat the site.vm file to have 4 space indents?

> - maven archetypes pop out xml with 2 space indenting, and maven xml  
> has 2 space indenting.  Re-indenting our stuff any time you run an  
> archetype or borrow some configuration from maven is a nuisance that  
> frequently is ignored and again the spacing difference makes  
> comparison quite difficult.

For those of us sensible enough to use IntelliJ, alt-cmd-L makes our  
world tidy.  Maybe we could get the archetype generator to take the  
number of spaces for an indent as a configuration parameter?

> Do you have an editor that can't deal with different indents for  
> different file types?
>
> thanks
> david jencks
>
>>
>> --jason
>>
>>
>> On Mar 13, 2008, at 6:34 AM, David Jencks wrote:
>>
>>> IIUC we have a coding standard of a 4 space indent for all files  
>>> (documented at http://cwiki.apache.org/GMOxDEV/coding-standards.html) 
>>> .  This can make working with maven difficult because its files  
>>> and xml output generatiion use 2 space indent for xml and .vm files.
>>>
>>> I think we could make life a lot easier when using maven tooling  
>>> to use a 2 space indent for xml and .vm and possibly other files.   
>>> At least with IDEA its easy to have different indents for java and  
>>> xml files.
>>>
>>> Comments?
>>>
>>> thanks
>>> david jencks
>>>
>>
>
>


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by David Jencks <da...@yahoo.com>.
On Mar 13, 2008, at 7:21 AM, Jason Dillon wrote:

> -1.  I don't think there is any value in making the indent for xml  
> or any other files different than the normal indent for all other  
> files.

Let me give a couple of examples where the 4-space indent causes a  
lot of pain and will continue to:

- in genesis geronimo-skin we have a site.vm file that is a slightly  
modified copy of the default .vm file from doxia-sitetools.  Trying  
to update it or compare it with different indents is quite an  
experience.
- maven archetypes pop out xml with 2 space indenting, and maven xml  
has 2 space indenting.  Re-indenting our stuff any time you run an  
archetype or borrow some configuration from maven is a nuisance that  
frequently is ignored and again the spacing difference makes  
comparison quite difficult.

Do you have an editor that can't deal with different indents for  
different file types?

thanks
david jencks

>
> --jason
>
>
> On Mar 13, 2008, at 6:34 AM, David Jencks wrote:
>
>> IIUC we have a coding standard of a 4 space indent for all files  
>> (documented at http://cwiki.apache.org/GMOxDEV/coding- 
>> standards.html).  This can make working with maven difficult  
>> because its files and xml output generatiion use 2 space indent  
>> for xml and .vm files.
>>
>> I think we could make life a lot easier when using maven tooling  
>> to use a 2 space indent for xml and .vm and possibly other files.   
>> At least with IDEA its easy to have different indents for java and  
>> xml files.
>>
>> Comments?
>>
>> thanks
>> david jencks
>>
>


Re: [PROPOSAL] Indent 2 spaces in xml and vm files to match more common usage, especially maven.

Posted by Jason Dillon <ja...@planet57.com>.
-1.  I don't think there is any value in making the indent for xml or  
any other files different than the normal indent for all other files.

--jason


On Mar 13, 2008, at 6:34 AM, David Jencks wrote:

> IIUC we have a coding standard of a 4 space indent for all files  
> (documented at http://cwiki.apache.org/GMOxDEV/coding- 
> standards.html).  This can make working with maven difficult because  
> its files and xml output generatiion use 2 space indent for xml  
> and .vm files.
>
> I think we could make life a lot easier when using maven tooling to  
> use a 2 space indent for xml and .vm and possibly other files.  At  
> least with IDEA its easy to have different indents for java and xml  
> files.
>
> Comments?
>
> thanks
> david jencks
>