Re: [KVM-AUTOTEST] Style guides for autotest

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

 



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

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux