[Nix-dev] Bash style in nix expressions
zimbatm
zimbatm at zimbatm.com
Fri Feb 19 00:37:01 CET 2016
Hi list,
Haskell has a really cool package called ShellCheck which you can run
against shell scripts. It's a linting tool that catches a ton of issues,
especially escaping ones.
Unfortunately nix expressions embed the shell fragments so it's hard to run
the tool against them. Has anyone had any success doing that or
experimented with attaching a build.sh that contains the steps as functions
instead ?
Another thing I noticed, since we depend on bash4+ features in the stdenv
setup.sh script, what is our policy regarding shell style ?
It's rather inconsistent across the board. Luckily $out is guaranteed not
to contain any spaces so escaping is less of an issue but we could make use
of [[ ]] tests for example that don't have the escaping problems that the [
] has.
That's all I have to say on bash for now, maybe other person have had more
thoughts about this subject.
Cheers,
z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160218/f6cdc18c/attachment.html
More information about the nix-dev
mailing list