diff --git a/build-support/bin/ci.sh b/build-support/bin/ci.sh index fa12ca919a8..73dacea9906 100755 --- a/build-support/bin/ci.sh +++ b/build-support/bin/ci.sh @@ -94,7 +94,7 @@ fi if [[ "${skip_pre_commit_checks:-false}" == "false" ]]; then banner "Running pre-commit checks" - ./build-support/bin/pre-commit.sh || exit 1 + FULL_CHECK=1 ./build-support/bin/pre-commit.sh || exit 1 fi # TODO(John sirois): Re-plumb build such that it grabs constraints from the built python_binary diff --git a/build-support/bin/pre-commit.sh b/build-support/bin/pre-commit.sh index a8a7e7b83fe..d962375e1f4 100755 --- a/build-support/bin/pre-commit.sh +++ b/build-support/bin/pre-commit.sh @@ -4,8 +4,13 @@ source build-support/common.sh +if [[ -z $FULL_CHECK ]] +then + export GIT_HOOK=1 +fi + echo "Checking packages" && ./build-support/bin/check_packages.sh || exit 1 -echo "Checking imports" && GIT_HOOK=1 ./build-support/bin/isort.sh || \ +echo "Checking imports" && ./build-support/bin/isort.sh || \ die "To fix import sort order, run \`build-support/bin/isort.sh -f\`" echo "Checking headers" && ./build-support/bin/check_header.sh || exit 1 echo "Success" diff --git a/src/python/pants/backend/core/wrapped_globs.py b/src/python/pants/backend/core/wrapped_globs.py index 33d48b764da..5aef3822ec6 100644 --- a/src/python/pants/backend/core/wrapped_globs.py +++ b/src/python/pants/backend/core/wrapped_globs.py @@ -100,7 +100,9 @@ def files_calculator(): return result buildroot = get_buildroot() - rel_root = os.path.relpath(root, buildroot) if root != buildroot else '' + rel_root = os.path.relpath(root, buildroot) + if rel_root == '.': + rel_root = '' filespec = self.to_filespec(args, root=rel_root, excludes=excludes) return FilesetWithSpec(rel_root, filespec, files_calculator) diff --git a/tests/python/pants_test/tasks/test_what_changed.py b/tests/python/pants_test/tasks/test_what_changed.py index 3e0e5e9aa5f..ce6dfd0700d 100644 --- a/tests/python/pants_test/tasks/test_what_changed.py +++ b/tests/python/pants_test/tasks/test_what_changed.py @@ -13,7 +13,7 @@ from pants.backend.core.from_target import FromTarget from pants.backend.core.targets.resources import Resources from pants.backend.core.tasks.what_changed import WhatChanged -from pants.backend.core.wrapped_globs import RGlobs, Globs +from pants.backend.core.wrapped_globs import Globs, RGlobs from pants.backend.jvm.targets.jar_dependency import JarDependency from pants.backend.jvm.targets.jar_library import JarLibrary from pants.backend.jvm.targets.java_library import JavaLibrary