Skip to content

Commit

Permalink
Add import coding style specification
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Zawalski <scottz@google.com>



git-svn-id: svn://test.kernel.org/autotest/trunk@4738 592f7852-d20e-0410-864c-8624ca9c26a4
  • Loading branch information
jamesren committed Jul 29, 2010
1 parent b47ae6f commit 1a153d8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CODING_STYLE
Expand Up @@ -38,6 +38,30 @@ Don't use CamelCaps style in most places - use underscores to separate parts
of your variable_names please. I shall make a bedgrudging exception for class
names I suppose, but I'll still whine about it a lot.

Importing modules

The order of imports should be as follows:

Standard python modules
Non-standard python modules
Autotest modules

Within one of these three sections, all module imports using the from
keyword should appear after regular imports.
Modules should be lumped together on the same line.
Wildcard imports (from x import *) should be avoided if possible.
Classes should not be imported from modules, but modules may be imported
from packages, i.e.:
from common_lib import error
and not
from common_lib.error import AutoservError

For example:
import os, pickle, random, re, select, shutil, signal, StringIO, subprocess
import sys, time, urllib, urlparse
import MySQLdb
from common_lib import error


Importing modules

Expand Down

0 comments on commit 1a153d8

Please sign in to comment.