Skip to Content.
Sympa Menu

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

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: flux <flux AT sourcemage.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] Request for comments - formating in spells
  • Date: Tue, 22 Jul 2008 08:05:08 -0400

"Andraž 'ruskie' Levstik" (ruskie AT codemages.net) wrote [08.07.22 07:35]:
> 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
I'm fine with this (it's what we already have anyway).

> 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...)
There is a new issue that comes up with tabs: not everyone has tabs set
to the same width, so the formatting will be different on different
screens (this is probably the reason for the "no tabs" policy).
Tabspacing can be redefined in the different editors, but I have a
feeling we will end up in a war about tabspacing... "8 is best! No 4 is
best! You're all losers, 2! WTF, 5!" ad nauseum.

> 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.
I don't see anything wrong with either case. I know that it's more
annoying to type two spaces instead of one, which is perhaps why there
are people who prefer 1? I really don't think this one should even be an
issue (but I know that unfortunately it already is an issue). I suppose
the only way to decide will be to hear arguments from both sides of the
fence (anybody for tabs between these? :-P).

> 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"
I won't touch this one with a 40-foot pole :-).

> 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)
Personally, I use ${SPELL} unless I specifically need "${SPELL}" just
because I find being in the habit of using the braces is better than not
being in the habit and accidentally forgetting them when they actually
are needed. The braces don't hurt anyway. If there is a standard that is
decided on this, I won't mind following it, but otherwise I think I'd
just use braces for everything to ensure my good habit.

As a general comment, once some formatting rules are actually decided, I
think it would be great if someone could create syntax files for them,
so that in (for example) vim everything would format automatically the
way it's supposed to be without buggering the coder to do it. This can
even be done for no tabs and all spaces, as vim has options to
internally convert tabs to spaces (I've included a few vim modelines in
some of the cauldron scripts I edit for this purpose, so that I don't
break the formatting established before I started working here). I don't
have all that much experience with the nano/pico family of editors, and
only mild experience with *emacs, so I'm not aware if non-vi editors
have the same facilities, but if so, would anyone else like to have
syntax files?

--
Justin "flux" Boffemmyer
Cauldron wizard and general mage
Source Mage GNU/Linux
http://www.sourcemage.org

Attachment: pgp8IsX9ks_iG.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page