From c8efec02957b6381979a952156d8ef64fd792e3a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 27 Jul 2021 14:09:17 -0700 Subject: `spack style`: add `--root` option (#25085) This adds a `--root` option so that `spack style` can check style for a spack instance other than its own. We also change the inner workings of `spack style` so that `--config FILE` (and similar options for the various tools) options are used. This ensures that when `spack style` runs, it always uses the config from the running spack, and does *not* pick up configuration from the external root. - [x] add `--root` option to `spack style` - [x] add `--config` (or similar) option when invoking style tools - [x] add a test that verifies we can check an external instance --- .github/workflows/unit_tests.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '.github/workflows/unit_tests.yaml') diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 9caef56566..32b1baf39a 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -130,7 +130,7 @@ jobs: sudo apt-get -y update # Needed for unit tests sudo apt-get -y install \ - coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \ + coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \ patchelf # Needed for kcov sudo apt-get -y install cmake binutils-dev libcurl4-openssl-dev @@ -138,6 +138,11 @@ jobs: - name: Install Python packages run: | pip install --upgrade pip six setuptools codecov coverage[toml] + # ensure style checks are not skipped in unit tests for python >= 3.6 + # note that true/false (i.e., 1/0) are opposite in conditions in python and bash + if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then + pip install --upgrade flake8 isort>=4.3.5 mypy>=0.900 black + fi - name: Setup git configuration run: | # Need this for the git tests to succeed. -- cgit v1.2.3-60-g2f50