QA/Execution/Web Testing/Docs/Automation/StyleGuide: Difference between revisions

No edit summary
Line 4: Line 4:
==File headers==
==File headers==


    At the top of each file should have python file header  #!/usr/bin/env python
*At the top of each file should have python file header   
    #!/usr/bin/env python


    Each file should have a copy of the MPL http://www.mozilla.org/MPL/boilerplate-1.1/mpl-tri-license-sh
*Each file should have a copy of the [http://www.mozilla.org/MPL/boilerplate-1.1/mpl-tri-license-sh MPL]


    Each file should pass PEP8 except for line length, see below.   
*Each file should pass [http://www.python.org/dev/peps/pep-0008/ PEP8] except for line length, see below.   


    I.e. parameters  should have a comma and a space e.g.  def method(self, parameter) not def method(self,parameter), etc
** I.e. parameters  should have a comma and a space e.g.   
    Good: def method(self, parameter)  
    Bad:  def method(self,parameter), etc


     http://www.python.org/dev/peps/pep-0008/
      


     Lines should try not to have more than 100 characters. This allows 2 files to be side by side with no overlap for easier development.(I base this on MacVim on my MBP)
     Lines should try not to have more than 100 characters. This allows 2 files to be side by side with no overlap for easier development.(I base this on MacVim on my MBP)
Confirmed users
753

edits