On 09/06/15 03:21, Alec Warner wrote:
> On Sat, Jun 6, 2015 at 12:26 AM, Justin Lecher (jlec) <j...@gentoo.org
> <mailto:j...@gentoo.org>> wrote:
> 
> Hi everyone,
> 
> Can we get an agreement on how we are indenting metadata.xml?
> 
> I like to properly format and indent metadata.xml, but without having
> an agreement or policy on the indention, I make unhappy by choosing
> the wrong.
> 
> 
>> I was going to stay out of this, but I want to kind of circle back a bit. You
>> want to 'properly format' the documents. I guess part of my question is, what
>> would you do if the proper format was basically undefined?
> 
>> "Properly formatted" XML files isn't really what I consider a goal. Do you 
>> have
>> other goals?
> 
>> For instance:
> 
>> "I would like to standardize on spaces or tabs so that we can better automate
>> the tooling around metadata."
> 
>> Or perhaps more clearly:
> 
>> "I am writing tools that manipulate metadata.xml; while I can easily ingest
>> metadata.xml, producing the correct output is difficult when spaces or tabs 
>> are
>> mixed, can we consistently use one or the other?"
> 
>> Or another take:
> 
>> "I am trying to write a tool that manipulates metadata.xml and I am having
>> difficulty parsing entries that mix spaces and tabs, please help me."
> 
>> Some of these problems are solved by code (I'm pretty sure the latter problem
>> just requires a sane XML parser for instance.) I believe mgorny already 
>> provided
>> code that tried to solve problem 2.
> 
>> Problem 1 is sufficiently generic that it is hard to solve with a code 
>> snippet I
>> think.
> 
>> The point is these are all goals other than "I want to standardize on tabs or
>> spaces because I like starting tabs vs spaces flamewars on gentoo-dev." This 
>> is
>> not meant to be accusatory; merely that standardizing the format "because"
>> doesn't really solve anything (there is no problem statement.) Perhaps there 
>> is
>> an implied statement (consistency is generally better for all parties.) But 
>> even
>> that being clearly stated would be nice.
> 
>> -A

Hi Alec,

you are absolutely right. Having stated the goal more clearly would have help to
decide what it should be.

Nevertheless, I think the flames are quite small this time, and we rather heard
two opinions with their arguments.

The two options and the arguments are

tabs:
        * made for indention
        * Gentoo uses tabs everywhere
        ... and similar

2 spaces:
        * save space (2 spaces) on the 80 char line width

As XML ignores whitespaces per specification, the only rational argument is,
that Gentoo uses tabs in ebuilds, eclass, basically everywhere so we should also
use it in metadata.xml.

Or simply leave it to the maintainer with tabs (=4 spaces) as default or 2
spaces if wished.

So that is what we should decide on.


Coming back to your original point, the why.

I really like proper indentions.

That is why I started some while ago doing

xmlstarlet fo metadata.xml

using tabs on every commit. As you can imaging that upset some people so I
switched to 2 spaces, which was also not good.

The acute reason to come up with now, is my effort to fill the remote-id tags in
metadata.xml. xmlstarlet uses 2 spaces on insert, so I need to reformat the file
afterwards for consistency reason. Instead of finding to used indention style
and use that, I thought it might be useful to have a common style which can be
always applied. That would ease my effort and also future ones.

We could even do the formatting directly via repoman on every commit.

I hope that brought some substance to my question,

Justin



Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to