[rust-dev] Configuration files library for Rust

Daniel Micay danielmicay at gmail.com
Sat Jan 4 13:44:13 PST 2014


On Sat, Jan 4, 2014 at 4:35 PM, Tony Arcieri <bascule at gmail.com> wrote:
> On Sat, Jan 4, 2014 at 1:25 PM, Daniel Micay <danielmicay at gmail.com> wrote:
>>
>> I can believe that people are using poor tooling, as I can't
>> understand how a tab character would sneak in otherwise. It can be
>> easily prevented at both the text editor and version control layers.
>> Git can be asked to prevent commits with whitespace problems by
>> enabling the default pre-commit hook and setting either tabs or space
>> (and the width) in gitattributes.
>
>
> Believe it or not, not all problems of this nature can be caught by
> automatic tools, and this is particularly problematic in YAML. Let's look at
> a particular one, which is a *semantic* error in the structure of YAML which
> I don't think any automated tools can catch, but please, correct me if I'm
> wrong.
>
> What if the programmer intended to write:
>
> stuff:
>   one:
>     foo:
>       - a
>       - b
>     bar:
>       - c
>       - d
>   two:
>     foo:
>       - e
>       - f
>     bar:
>       - g
>       - h
>
> But instead wrote:
>
> stuff:
>   one:
>     foo:
>       - a
>       - b
>     bar:
>       - c
>       - d
>   two:
>     foo:
>       - e
>       - f
>   bar:
>     - g
>     - h
>
> ?

Not much of a problem with 8-space indents. This is not really any
different than messing up brace nesting. If you go out of the way to
obfuscate the code with 2-space indents then it's a problem.

> So if we're talking to a payment gateway, our automated tests should run
> against the live payment gateway? Surely you see there are many cases where
> this simply doesn't work.

I don't really. Wouldn't you want to test that it works with some
dummy accounts after you've done testing against a mocked one?


More information about the Rust-dev mailing list