Re: [PATCH 2/2] t7508-status: test all modes with color

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> writes:

> Jakub Narebski venit, vidit, dixit 08.12.2009 12:10:
>> Michael J Gruber wrote:
>> 
>>> +decrypt_color () {
>>> +       sed \
>>> +               -e 's/.\[1m/<WHITE>/g' \
>>> +               -e 's/.\[31m/<RED>/g' \
>>> +               -e 's/.\[32m/<GREEN>/g' \
>>> +               -e 's/.\[34m/<BLUE>/g' \
>>> +               -e 's/.\[m/<RESET>/g'
>>> +}
>> 
>> Shouldn't this be better in test-lib.sh, or some common lib 
>> (lib-color.sh or color-lib.sh; we are unfortunately a bit inconsistent
>> in naming here)?
>
> Well, so far it's used in two places (and somewhat differently). I would
> say test-libification starts at 3 :)

That is a pretty lame excuse and is a bad way to keep things maintainable.

Having two copies now means that you will *double* the chance for the next
person to copy and paste one of the existing copies that are found in the
non-library-ish part of the test script set to create the third duplicate,
without even realizing that there already are two copies that should have
been consolidated in the first place.  The worst part is that once that
duplication is pointed out, s/he will use the existing two copies as an
excuse for copy and paste.

Please don't.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]