Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] Request for comments - formating in spells

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Andraž 'ruskie' Levstik" <ruskie AT codemages.net>
  • To: <sm-discuss AT lists.ibiblio.org>
  • Subject: [SM-Discuss] Request for comments - formating in spells
  • Date: Tue, 22 Jul 2008 13:35:18 +0200

I'd like to propose that we start making some standards for spell file
formatting to stop all the white space commits that are recently becoming
popular with some. Along the way I'd like to propose a few changes to some
formatting and some other things.

a) we have a policy of no tabs in spell files other than HISTORY.

I propose we use tabs for general indentation in spells and spaces
for aligning.
Examples:
1)
DETAILS file is aligned on = I propose no tabs in this file as we have now:
SPELL=foo
VERSION=bar
SOURCE=$SPELL-VERSION

Tabs here would mess it up

2)
BUILD file when not default tends to be aligned on some conditional clauses
and end of line with configure and options:
if [[ foo == bar ]; then
[tab]./configure --opt1 \
[tab] --opt2 \
[tab] --opt3 &&
[tab]make
fi

([tab] means tab and " " space means space... so in the above lines there's
only one tab...)

b) Certain devs use double spaces in some cases some single

Examples:

DEPENDS file is one such:
depends spellA &&
depends spellB &&
depends spellC &&
depends spellD

Personally I see nothing wrong with double spaces as it makes the spell
list easier to read but some disilke it. If nothing else it needs to be
discussed.

c) End of line continuation

Some want to use the \ and && and || continuation at character 78 some two
spaces after the command some one space after the command etc...

Examples:
make all &&
make foo &&
make &&
foo \
bar \
baz &&
echo "abc"

d) quotes and curly braces etc...

$SPELL vs "$SPELL" vs ${SPELL} vs "${SPELL}"

here the answer is rather simple:
if you know you will need any of the extra features use the one that gives
them to you, the one exception are automated scripts(i.e. quill)


This is what I have found from my own observations. As said this is a RFC
so feel free to comment with your own suggestions and ideas. At the end
I/or whoever will present the findings to others for final comments and
then to the grimoire lead to rubber stamp them :)

Let the slaughter commence...

--
Andraž "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru
Geek/Hacker/Tinker

Be sure brain is in gear before engaging mouth.
Quis custodiet ipsos custodies.
Ryle hira.

Key id = F4C1F89C
Key fingerprint = 6FF2 8F20 4C9D DB36 B5B6 F134 884D 72CC F4C1 F89C





Archive powered by MHonArc 2.6.24.

Top of Page