From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [KVM-AUTOTEST] Style guides for autotest Date: Mon, 08 Jun 2009 01:35:34 -0300 Message-ID: <1244435734.2666.13.camel@localhost.localdomain> References: <1823305158.1384151244380682202.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: jasowang@redhat.com, aeromenk@redhat.com, Mike Burns , yzhou@redhat.com, supriyak@in.ibm.com, byang@redhat.com, Yogi , David Huff , Dor Laor , Autotest mailing list , KVM mailing list To: Michael Goldish Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47890 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbZFHEfq (ORCPT ); Mon, 8 Jun 2009 00:35:46 -0400 In-Reply-To: <1823305158.1384151244380682202.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, 2009-06-07 at 09:18 -0400, Michael Goldish wrote: > Sorry, I forgot two things: > > - PEP 8 states that class methods should be separated by a single blank line (whereas top level functions should be separated by two blank lines). After the recent modifications, the KVM test no longer follows this convention as its class methods are separated by two blank lines. On autotest, we opted by separate both functions and class methods using 2 lines, 'overriding' the PEP on this aspect in particular. > - PEP 257 states that a class docstring should be separated by a single blank line from the class header and from the first method following the docstring, e.g. > > class VM: > > """ > This class ... > """ > > def __init__(... > > The KVM test no longer follows this convention after the merge (in kvm_vm.py, kvm_config.py, kvm_utils.py, kvm.py and possibly other files). Indeed we didn't follow that recommendation. Will look at fix that one. > There may be a few more style "violations" or inconsistencies I forgot to mention, or just haven't noticed yet. > > I realize PEPs are merely recommendations, but since Autotest doesn't have a consistent style of its own, why not follow the PEPs? Agree. On the CODING_STYLE document, we state: {{{ Base coding style When writing python code, unless otherwise stated, stick to the python style guide (http://www.python.org/dev/peps/pep-0008/). }}} We want to make the autotest coding standard conventions as consistent as possible. Inside the code, some mistakes might have happened, and eventually, those will be fixed out. Thanks for your comments, will work to get things as consistent as possible! -- Lucas Meneghel Rodrigues Software Engineer (QE) Red Hat - Emerging Technologies