Repository: mesos Updated Branches: refs/heads/master 476a8096d -> 7c6969941
Fixed linting script when run with no arguments. The python linter needs to be run in a virtualenv due to how it requires multiple modules that may or may not be installed (or the correct version) in the host environment. We originally re-made this virtualenv whenever some specific files were changed (such as the pip-requirements.txt, which describes the virtualenv's dependencies). However, this logic was missing the case where we ran support/mesos-style.py with no arguments. In this case, the entire codebase is linted. Therefore, the virtualenv should also be rebuilt in this case. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2e55afb3 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2e55afb3 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2e55afb3 Branch: refs/heads/master Commit: 2e55afb35a912d0b6f8968bfb34832e645cb7903 Parents: 476a809 Author: Joseph Wu <[email protected]> Authored: Tue Apr 11 17:52:28 2017 -0700 Committer: Joseph Wu <[email protected]> Committed: Tue Apr 11 17:52:28 2017 -0700 ---------------------------------------------------------------------- support/mesos-style.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/2e55afb3/support/mesos-style.py ---------------------------------------------------------------------- diff --git a/support/mesos-style.py b/support/mesos-style.py index 6489c2d..5828040 100755 --- a/support/mesos-style.py +++ b/support/mesos-style.py @@ -296,12 +296,15 @@ class PyLinter(LinterBase): if 'pip-requirements.txt' in basenames: print 'The "pip-requirements.txt" file has changed.' - print 'Rebuilding virtualenv ...' return True if 'mesos.bash_completion' in basenames: print 'The "mesos.bash_completion" file has changed.' - print 'Rebuilding virtualenv ...' + return True + + # NOTE: If the file list is empty, we are linting the entire codebase. + # We should always rebuild the virtualenv in this case. + if len(file_list) <= 0: return True return False @@ -312,6 +315,8 @@ class PyLinter(LinterBase): ''' cli_dir = os.path.abspath(self.source_dirs[0]) + print 'Rebuilding virtualenv ...' + p = subprocess.Popen( [os.path.join(cli_dir, 'bootstrap')], stdout=subprocess.PIPE)
