diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-04-22 21:55:20 +0900 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2019-05-01 04:44:02 +0900 |
commit | 8e5e36dc0bcb8a1740d764359b36627cb4a30cef (patch) | |
tree | e4fabbc4c774c953efb3240196b15d4e02a181c0 | |
parent | f41103770d84d676534021f4bd65bbebfb1f3b8a (diff) | |
download | spack-8e5e36dc0bcb8a1740d764359b36627cb4a30cef.tar.gz spack-8e5e36dc0bcb8a1740d764359b36627cb4a30cef.tar.bz2 spack-8e5e36dc0bcb8a1740d764359b36627cb4a30cef.tar.xz spack-8e5e36dc0bcb8a1740d764359b36627cb4a30cef.zip |
Fix spack flake8 to use Travis's target as base when needed
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | lib/spack/spack/cmd/flake8.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index edf18f7311..694ada8cc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -211,7 +211,7 @@ before_script: - git config --global user.name "Test User" # Need this to be able to compute the list of changed files - - git fetch origin develop:develop + - git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH} # Set up external deps for build tests, b/c they take too long to compile - if [[ "$TEST_SUITE" == "build" ]]; then diff --git a/lib/spack/spack/cmd/flake8.py b/lib/spack/spack/cmd/flake8.py index 534ab1c4ba..105ede2c70 100644 --- a/lib/spack/spack/cmd/flake8.py +++ b/lib/spack/spack/cmd/flake8.py @@ -96,7 +96,11 @@ def changed_files(args): git = which('git', required=True) - range = "{0}...".format(args.base) + base = args.base + if base is None: + base = os.environ.get('TRAVIS_BRANCH', 'develop') + + range = "{0}...".format(base) git_args = [ # Add changed files committed since branching off of develop @@ -193,7 +197,7 @@ def filter_file(source, dest, output=False): def setup_parser(subparser): subparser.add_argument( - '-b', '--base', action='store', default='develop', + '-b', '--base', action='store', default=None, help="select base branch for collecting list of modified files") subparser.add_argument( '-k', '--keep-temp', action='store_true', |