You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/04/12 01:04:02 UTC

[2/2] mesos git commit: Fixed some style issues in the style linting script.

Fixed some style issues in the style linting script.

Running `support/mesos-style.py` on itself results in a couple
dozen errors.  This fixes a few minor whitespace/naming errors.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7c696994
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7c696994
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7c696994

Branch: refs/heads/master
Commit: 7c696994110ec4223edc1d83d4212b116157c8cf
Parents: 2e55afb
Author: Joseph Wu <jo...@apache.org>
Authored: Tue Apr 11 18:01:18 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Apr 11 18:02:45 2017 -0700

----------------------------------------------------------------------
 support/mesos-style.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7c696994/support/mesos-style.py
----------------------------------------------------------------------
diff --git a/support/mesos-style.py b/support/mesos-style.py
index 5828040..53ffe3b 100755
--- a/support/mesos-style.py
+++ b/support/mesos-style.py
@@ -60,7 +60,7 @@ class LinterBase(object):
         '''
         exclude_file_regex = re.compile(self.exclude_files)
         source_criteria_regex = re.compile(self.source_files)
-        for root, dirs, files in os.walk(root_dir):
+        for root, _, files in os.walk(root_dir):
             for name in files:
                 path = os.path.join(root, name)
                 if exclude_file_regex.search(path) is not None:
@@ -268,8 +268,8 @@ class PyLinter(LinterBase):
             ['. {virtualenv_dir}/bin/activate; \
              PYTHONPATH={lib_dir}:{bin_dir} pylint --rcfile={config} --ignore={ignore} {files}'.\
              format(virtualenv_dir=os.path.join(cli_dir, '.virtualenv'),
-                    lib_dir=os.path.join(cli_dir,'lib'),
-                    bin_dir=os.path.join(cli_dir,'bin'),
+                    lib_dir=os.path.join(cli_dir, 'lib'),
+                    bin_dir=os.path.join(cli_dir, 'bin'),
                     config=os.path.join(cli_dir, 'pylint.config'),
                     ignore=os.path.join(cli_dir, 'bin', 'mesos'),
                     files=source_files)],
@@ -292,7 +292,7 @@ class PyLinter(LinterBase):
 
         basenames = []
         if file_list:
-            basenames = [os.path.basename(file) for file in file_list]
+            basenames = [os.path.basename(path) for path in file_list]
 
         if 'pip-requirements.txt' in basenames:
             print 'The "pip-requirements.txt" file has changed.'
@@ -329,16 +329,16 @@ class PyLinter(LinterBase):
 
         if p.returncode != 0:
             sys.stderr.write(output)
-            sys.exit(1);
+            sys.exit(1)
 
     def main(self, file_list):
-       '''
-       Override main to rebuild our virtualenv if necessary.
-       '''
-       if self.__should_build_virtualenv(file_list):
-           self.__build_virtualenv()
+        '''
+        Override main to rebuild our virtualenv if necessary.
+        '''
+        if self.__should_build_virtualenv(file_list):
+            self.__build_virtualenv()
 
-       return super(PyLinter, self).main(file_list)
+        return super(PyLinter, self).main(file_list)
 
 
 if __name__ == '__main__':