Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591548 - what is valid indentation in metadata.xml?
Summary: what is valid indentation in metadata.xml?
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Gentoo Devmanual Team
URL: https://devmanual.gentoo.org/ebuild-w...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 20:15 UTC by Jonas Stein
Modified: 2020-05-06 13:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Stein gentoo-dev 2016-08-17 20:15:44 UTC
The indentation of matadata.xml is different in https://wiki.gentoo.org/wiki/GLEP:68 and https://devmanual.gentoo.org/ebuild-writing/misc-files/metadata/ the first uses TAB the second spaces.

app-vim/gentoo-syntax uses \t

I suggest to define what the requirements for a proper indentation are. Is it any combination of space and \t, as long it is valid .xml, or must it be a \t, or ...

The grep line is a bit too simple, but gives an idea of the current situation


/usr/portage$ grep -e "^  " *-*/*/metadata.xml | wc -l
61311
/usr/portage$ grep -Pe "^\t" *-*/*/metadata.xml | wc -l
85194

Reproducible: Always
Comment 1 Ulrich Müller gentoo-dev 2016-08-17 20:48:47 UTC
IMHO indentation should be two spaces, and tabs should be forbidden. This is the default of Emacs' XML mode, and is also what is used elsewhere in Gentoo documentation, e.g. in the devmanual source:
https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/doc/en/xml-guide.xml?revision=1.72&view=markup#l1107

However, whenever the topic came up in the mailing lists there never was any agreement.

Presumably, we could settle on something like the following minimal set of rules:
- The file must be valid XML.
- Indentation should be consistent, i.e. either spaces or tabs, but not both.
- Keep the existing style when touching another dev's file.
Comment 2 Jonas Stein gentoo-dev 2016-08-17 20:54:16 UTC
Coacher sent me a pointer to 
https://archives.gentoo.org/gentoo-dev/message/9e1aafedf11149da577a95840d5322db?
now, which was an interesting discussion about the same topic in 2015.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2016-08-17 20:55:23 UTC
(In reply to Ulrich Müller from comment #1)
> Presumably, we could settle on something like the following minimal set of
> rules:
> - The file must be valid XML.
> - Indentation should be consistent, i.e. either spaces or tabs, but not both.
> - Keep the existing style when touching another dev's file.

I agree with this, and doubt it would ever be possible to get consensus on much more than that.
Comment 4 Göktürk Yüksek archtester gentoo-dev 2016-08-18 03:16:06 UTC
(In reply to Ulrich Müller from comment #1)
> IMHO indentation should be two spaces, and tabs should be forbidden. This is
> the default of Emacs' XML mode, and is also what is used elsewhere in Gentoo
> documentation, e.g. in the devmanual source:
> https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/doc/en/xml-
> guide.xml?revision=1.72&view=markup#l1107
> 
> However, whenever the topic came up in the mailing lists there never was any
> agreement.
> 
> Presumably, we could settle on something like the following minimal set of
> rules:
> - The file must be valid XML.
> - Indentation should be consistent, i.e. either spaces or tabs, but not both.
> - Keep the existing style when touching another dev's file.

I agree with the above. The GLEP example uses tab but it's not specified as part of the GLEP. I used spaces in devmanual to have a more compact layout.
Comment 5 Sebastian Pipping gentoo-dev 2016-08-18 11:06:38 UTC
(In reply to Ulrich Müller from comment #1)
> Presumably, we could settle on something like the following minimal set of
> rules:
> - The file must be valid XML.
> - Indentation should be consistent, i.e. either spaces or tabs, but not both.
> - Keep the existing style when touching another dev's file.

Excellent approach, +1 from me.
Comment 6 Wim Muskee 2016-12-12 05:19:32 UTC
fixed in https://github.com/gentoo/devmanual.gentoo.org/commit/49fb72be41dc38a280c3da6a259dd229b85baf59 and visible on the webpage