[Piglit] [PATCH 4/4] gen_const_builtin_equal_tests.py: cleanup a few pylint errors

Dylan Baker baker.dylan.c at gmail.com
Mon May 19 15:09:22 PDT 2014


On Monday, May 19, 2014 18:04:29 Ilia Mirkin wrote:
> On Mon, May 19, 2014 at 6:00 PM, Dylan Baker 
<baker.dylan.c at gmail.com> wrote:
> > On Monday, May 19, 2014 17:54:28 Ilia Mirkin wrote:
> >> On Mon, May 19, 2014 at 5:43 PM, Dylan Baker 
<baker.dylan.c at gmail.com>
> >> 
> >> wrote:
> >> > Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> >> > 
> >> > ---
> >> > 
> >> > generated_tests/gen_const_builtin_equal_tests.py | 77
> >> > +++++++++---------------
> >> > 
> >> > 1 file changed, 29 insertions(+), 48 deletions(-)
> >> > 
> >> > 
> >> > 
> >> > diff --git a/generated_tests/gen_const_builtin_equal_tests.py
> >> > b/generated_tests/gen_const_builtin_equal_tests.py
> >> > 
> >> > index 79b5a1d..0e7543f 100644
> >> > 
> >> > --- a/generated_tests/gen_const_builtin_equal_tests.py
> >> > 
> >> > +++ b/generated_tests/gen_const_builtin_equal_tests.py
> >> > 
> >> > @@ -48,53 +48,34 @@ TEMPLATE =
> >> > mako.template.Template(textwrap.dedent("""
> >> > 
> >> > draw rect -1 -1 2 2
> >> > 
> >> > probe all rgb 0.0 1.0 0.0"""))
> >> > 
> >> > 
> >> > 
> >> > -test_vectors = [
> >> > 
> >> > - [
> >> > 
> >> > - "vec2(3.0, 3.14)",
> >> > 
> >> > - "vec2(-6.0, 7.88)",
> >> > 
> >> > - "bvec2(false, false)"
> >> > 
> >> > - ],
> >> > 
> >> > - [
> >> 
> >> I really like the visual separation between the different test cases
> >> 
> >> here... what is it that pylint is complaining about? Just test_vectors
> >> 
> >> vs TEST_VECTORS?
> >> 
> >> 
> >> 
> >> Perhaps a format more like
> >> 
> >> 
> >> 
> >> + ["vec2(3.0, 3.14)",
> >> 
> >> + "vec2(-6.0, 7.88)",
> >> 
> >> + "bvec2(false, false)"
> >> 
> >> ],
> >> 
> >> + ["vec3(13.4, -0.9, 12.55)",
> >> 
> >> + "vec3(13.4, 12.0, -55.3)",
> >> 
> >> + "bvec3(true, false, false)"
> >> 
> >> ],
> >> 
> >> 
> >> 
> >> Would keep pylint happy while preserving the visual separation 
between
> >> 
> >> the test cases?
> >> 
> >> > - "vec3(13.4, -0.9, 12.55)",
> >> > 
> >> > - "vec3(13.4, 12.0, -55.3)",
> >> > 
> >> > - "bvec3(true, false, false)"
> > 
> > it complains about bad hanging indent, it wants the '],' to be 
dedented
> > 
> > which results in:
> > 
> > ],
> > 
> > [
> > 
> > ...
> > 
> > ],
> > 
> > [
> > 
> > 
> > 
> > And that just adds a lot of white space. could we go to:
> > 
> > [
> > 
> > ...],
> > 
> > [
> > 
> > ...],
> 
> Is the diff between that and my suggestion whether the first line is
> empty vs last line? I don't really care. Although a minor prefer for
> "my" way, since that way adding elements to the array doesn't require
> changing any lines if items are added to the end. (I also like
> trailing commas for that reason.)
> 
> Or perhaps I misunderstood, can you give an example with the actual
> values filled in for like 2 elements of the array?

Actually, I think your suggestion is fine. My client did something weird to it 
but looking at it in webmail it looks fine. I'll send out a v2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140519/53ceb121/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140519/53ceb121/attachment-0001.sig>


More information about the Piglit mailing list