80 cols on XML file

27 views
Skip to first unread message

Cédric Krier

unread,
Dec 20, 2017, 10:00:05 AM12/20/17
to Tryton
Hi,

I think we should remove the 80 cols limit on XML file.
The rational is that XML file are indented by 4 spaces with at least 2
indentation (<tryton/> and <data/>) but also XML is quite verbose.
So we reach the limit very quickly and so we add line break which makes
the XML more difficult to read. Also most of the time 'pyson' attribute
already exceed the limit and it can not be break in multiple line.

I think we should be more flexible. For example the <record/> line with
'model' and 'id' is more readable when not split. But <menu/> is more
readable if each attribute is on his own line.

So I think the style should be one line with all attributes or one
attribute per line, but not allow mixed.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Bernat Brunet

unread,
Dec 20, 2017, 11:12:15 AM12/20/17
to tryto...@googlegroups.com
2017-12-20 15:55 GMT+01:00 Cédric Krier <cedric...@b2ck.com>:
Hi,

I think we should remove the 80 cols limit on XML file.
The rational is that XML file are indented by 4 spaces with at least 2
indentation (<tryton/> and <data/>) but also XML is quite verbose.
So we reach the limit very quickly and so we add line break which makes
the XML more difficult to read. Also most of the time 'pyson' attribute
already exceed the limit and it can not be break in multiple line.

I think we should be more flexible. For example the <record/> line with
'model' and 'id' is more readable when not split. But <menu/> is more
readable if each attribute is on his own line.

So I think the style should be one line with all attributes or one
attribute per line, but not allow mixed.

+1

For me will be better if it's one attribute per line. Because sometimes when working with the laptop all in one line wont be good.


--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

--
You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20171220145518.GU8635%40kei.



--
Bernat Brunet
http://www.NaN-tic.com
Telf: (+34) 935 531 803

http://twitter.com/nan_tic
http://www.nan-tic.com/blog

-------------------------------------------

Advertència Legal: aquest missatge i, en el seu cas, els fitxers adjunts poden contenir informació privada
i/o confidencial. Si vostè no és el destinatari del missatge, si us plau, elimini i notifiqui'ns-ho
immediatament, no el reenvii ni copi el seu contingut. Si us plau, avisi'ns d'immediat si vostè o la seva
empresa no admeten la utilització del correu electrònic via internet per a missatges d'aquest tipus.
NaN Projectes de Programari Lliure, S.L. no garanteix la confidencialitat, integritat, rapidesa o correcte
recepció del present correu, ni es responsabilitza de possibles perjudicis derivats de la captura,
incorporacions de virus o qualsevol altre manipulació efectuada per tercers. No s'autoritza la utilització
amb finalitats comercials o per a la seva incorporació a fitxers automatitzats de les direccions de
l'emissor o del destinatari. La informació continguda en aquest missatge de correu electrònic és confidencial i pot revestir el caràcter
de reservada. Està dirigida exclusivament a la persona destinatària. L'accés o qualsevol us per part de
qualsevol altra persona, no estan autoritzats i poden esdevenir il·legals. Si vostè no és la persona
destinatària, li preguem que procedeixi a esborrar-lo i a no fer-ne cap us ni transmetre'l a tercers.
Si ho considera oportú pot avisar al remitent que el missatge ha arribat a un destí no desitjat.
Advertencia Legal: este mensaje y, en su caso, los ficheros anexos pueden contener información privilegiada
y/o confidencial. Si usted no es el destinatario del mensaje, por favor, bórrelo y notifíquenoslo
inmediatamente, no lo reenvíe ni copie su contenido. Por favor, avísenos de inmediato si usted o su empresa
no admite la utilización del correo electrónico vía internet para mensajes de este tipo. Nan Projectes de
Programari Lliure, S.L. no garantiza la confidencialidad, integridad, rapidez o correcta recepción del
presente correo, ni se responsabiliza de posibles perjuicios derivados de la captura, incorporaciones de
virus o cualesquiera otras manipulaciones efectuadas por terceros. No se autoriza la utilización con fines
comerciales o para su incorporación a ficheros automatizados de las direcciones del emisor o del
destinatario. La información contenida en este mensaje de correo electrónico es confidencial y puede revestir el carácter
de reservada. Está dirigida exclusivamente a la persona destinataria. El acceso o cualquier uso por parte
de cualquier otra persona, no están autorizados y pueden llegar a ser ilegales. Si usted no es la persona
destinataria, le rogamos que proceda a borrarlo y no hacer ningún uso de él ni transmitirlo a terceros.
Si lo considera oportuno puede avisar al remitente que el mensaje ha llegado a un destino no deseado.

Maxime Richez

unread,
Dec 21, 2017, 10:12:17 AM12/21/17
to tryton-dev
+1

Richard PALO

unread,
Dec 21, 2017, 10:35:07 AM12/21/17
to tryto...@googlegroups.com
Le 20/12/2017 à 16:45, Bernat Brunet a écrit :
>
>
> 2017-12-20 15:55 GMT+01:00 Cédric Krier <cedric...@b2ck.com <mailto:cedric...@b2ck.com>>:
>
> Hi,
>
> I think we should remove the 80 cols limit on XML file.
> The rational is that XML file are indented by 4 spaces with at least 2
> indentation (<tryton/> and <data/>) but also XML is quite verbose.
> So we reach the limit very quickly and so we add line break which makes
> the XML more difficult to read. Also most of the time 'pyson' attribute
> already exceed the limit and it can not be break in multiple line.
>
> I think we should be more flexible. For example the <record/> line with
> 'model' and 'id' is more readable when not split. But <menu/> is more
> readable if each attribute is on his own line.
>
> So I think the style should be one line with all attributes or one
> attribute per line, but not allow mixed.
>
>
> +1
>
> For me will be better if it's one attribute per line. Because sometimes when working with the laptop all in one line wont be good.
>

I'm starting to tend toward what certain software do in terms of leaving
that sort of formatting to pretty printers like xml_pp, xmlstarlet or what have you.

In general, the output file is most certainly not intended to be interpreted directly
by a human without some sort of tool or program (read: filter).

In other words, it could simply all go on one line.

cheers,
--
Richard PALO

Raimon Esteve

unread,
Dec 21, 2017, 7:00:08 PM12/21/17
to tryto...@googlegroups.com
+1

Regards

Cédric Krier

unread,
Dec 22, 2017, 9:40:06 AM12/22/17
to Tryton
On 2017-12-20 15:55, Cédric Krier wrote:
> Hi,
>
> I think we should remove the 80 cols limit on XML file.
> The rational is that XML file are indented by 4 spaces with at least 2
> indentation (<tryton/> and <data/>) but also XML is quite verbose.
> So we reach the limit very quickly and so we add line break which makes
> the XML more difficult to read. Also most of the time 'pyson' attribute
> already exceed the limit and it can not be break in multiple line.
>
> I think we should be more flexible. For example the <record/> line with
> 'model' and 'id' is more readable when not split. But <menu/> is more
> readable if each attribute is on his own line.
>
> So I think the style should be one line with all attributes or one
> attribute per line, but not allow mixed.

Here is the style update: https://codereview.tryton.org/43871002
Reply all
Reply to author
Forward
0 new messages