Enables pylint for .py files in autotest.

1. Patch run_pylint so pylint understands autotest_lib imports.
2. Patches pylint to understand 'import common'
An unused improt error is only thrown if we don't see an
autotest_lib import in the same scope.
3. Refactors run_pylint to handle command line invocation with
multiple arguments correctly.
4. Adds a presubmit hook so we run pylint for autotest checkis.
5. Adds a pylintrc file, which only checks unused imports for now.

Edit: Patches pylint to completely ignore import common.

Currently, pylint only ignores 'import common' if it finds an
autotest_lib in the same scope. This change patches pylint
to completely ignore 'import common' regardless of autotest_lib.
Sometimes the 'from' imports are parsed ahead of the regular
imports, a more thorough understanding of when this happens
is necessary before we can make pylint smarter.

TEST=ran run_pylint on all python files in site_utils/
BUG=chromium-os:37650

Change-Id: Idf0d93f7a068c5d99b378f224e46ff6e524b4d0a
Reviewed-on: https://gerrit.chromium.org/gerrit/40554
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
Tested-by: Prashanth Balasubramanian <beeps@chromium.org>
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
diff --git a/PRESUBMIT.cfg b/PRESUBMIT.cfg
index 64da5e6..ad37e85 100644
--- a/PRESUBMIT.cfg
+++ b/PRESUBMIT.cfg
@@ -1,5 +1,10 @@
-# This config file disables some of the ChromiumOS source style checks.
-# Comment out the disable-flags for any checks you want to leave enabled.
+# This config file disables some of the ChromiumOS source style checks and
+# adds a hook to validate .py files. Comment out the disable-flags for
+# any checks you want to leave enabled. Edit utils/pylintrc to disable any
+# pylint checks.
 
 [Hook Overrides]
 cros_license_check: false
+
+[Hook Scripts]
+hook0 = ./utils/run_pylint.py