Scripting guidelines

Alon Bar-Lev alonbl at redhat.com
Fri Feb 21 08:06:31 UTC 2014



----- Original Message -----
> From: "Eyal Edri" <eedri at redhat.com>
> To: "David Caro" <dcaroest at redhat.com>
> Cc: "infra" <infra at ovirt.org>
> Sent: Friday, February 21, 2014 8:49:06 AM
> Subject: Re: Scripting guidelines
> 
> 
> 
> ----- Original Message -----
> > From: "David Caro" <dcaroest at redhat.com>
> > To: "infra" <infra at ovirt.org>
> > Sent: Thursday, February 20, 2014 10:52:23 PM
> > Subject: Scripting guidelines
> > 
> > Hi everyone!
> > 
> > Lately I've had a hard time to properly review some patches containing
> > shell
> > scripts to manage our infrastructure because there's no guidelines. So I
> > created
> > a wiki page with a proposal [1]. It's made up as a mix of some already
> > existing
> > guidelines.
> > 
> > The reason to wrote a bash style guide and not a shell stile guide is
> > because
> > I
> > think that bash is widely adopted (default GNU shell) and provides enough
> > advantages to sacrifice some portability. I think that most of our
> > maintenance
> > and management scripts will never be run on non-GNU OSes.
> > 
> > POSIX compliance should be only used when really needed, for example,
> > scripts
> > to
> > build a specific project, that might be run on non-GNU based systems in the
> > far
> > future.
> > 
> > This thread is to start a discussion about it so please, share your
> > opinions
> > and
> > concerns (and proposals).
> 
> +1, i also believe that it's better to write code that is easy to read and
> maintain
> rather than to make a special effort to be compliant for something is will
> not necessarily be needed.
> it sometimes can add unnecessarily delays to a certain needed infra task, for
> the wrong reasons imo.
> 
> if an infra member has a strong previous experience with POSIX rather bash
> bash, not sure this should
> be enforced, but other than that i think that having a base guideline for
> writing infra scripts is a good thing.
> 
> ultimately, i think the final decision for how to write the code stands in
> the hands of who's writing it,
> and we shouldn't block / -1 patches just on style (bash/posix) and focus on
> the logic / correctness of the code.

When I educate people I do this to allow people to contribute to any project.

In our case this will enable people to contribute to infra and product.

Having your own conventions to infra which are not following product standard will make it difficult to reuse people skills.

POSIX code is not less readable, one just need to accept that we follow standards and everything else will be aligned.

> 
> Eyal.
> 
> 
> 
> > 
> > 
> > [1] http://www.ovirt.org/Bash_style_guide
> > 
> > Cheers!
> > 
> > --
> > David Caro
> > 
> > Red Hat S.L.
> > Continuous Integration Engineer - EMEA ENG Virtualization R&D
> > 
> > Email: dcaro at redhat.com
> > Web: www.redhat.com
> > RHT Global #: 82-62605
> > 
> > 
> > _______________________________________________
> > Infra mailing list
> > Infra at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/infra
> > 
> _______________________________________________
> Infra mailing list
> Infra at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/infra
> 



More information about the Infra mailing list