summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2021-07-04 01:53:02 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2021-07-07 17:27:31 -0700
commit24a4d81097c2a930b34d55e25400d14b74ec4112 (patch)
treedeb21e1d2706371226e846a2a5b84cdccfdece55 /share
parentb5d2c30d26060d4a55c88c1a665b6e9d95ba1644 (diff)
downloadspack-24a4d81097c2a930b34d55e25400d14b74ec4112.tar.gz
spack-24a4d81097c2a930b34d55e25400d14b74ec4112.tar.bz2
spack-24a4d81097c2a930b34d55e25400d14b74ec4112.tar.xz
spack-24a4d81097c2a930b34d55e25400d14b74ec4112.zip
style: clean up and restructure `spack style` command
This consolidates code across tools in `spack style` so that each `run_<tool>` function can be called indirecty through a dictionary of handlers, and os that checks like finding the executable for the tool can be shared across commands. - [x] rework `spack style` to use decorators to register tools - [x] define tool order in one place in `spack style` - [x] fix python 2/3 issues to Get `isort` checks working - [x] make isort error regex more robust across versions - [x] remove unused output option - [x] change vestigial `TRAVIS_BRANCH` to `GITHUB_BASE_REF` - [x] update completion
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/run-style-tests2
-rwxr-xr-xshare/spack/spack-completion.bash4
2 files changed, 3 insertions, 3 deletions
diff --git a/share/spack/qa/run-style-tests b/share/spack/qa/run-style-tests
index 23d756a3bc..4eb503dae2 100755
--- a/share/spack/qa/run-style-tests
+++ b/share/spack/qa/run-style-tests
@@ -18,7 +18,7 @@
check_dependencies flake8 mypy
# verify that the code style is correct
-spack style
+spack style --root-relative
# verify that the license headers are present
spack license verify
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 08a4c999c9..cd5a01c42d 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -978,7 +978,7 @@ _spack_find() {
_spack_flake8() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -b --base -a --all -o --output -r --root-relative -U --no-untracked --no-flake8 --no-mypy --black"
+ SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black"
else
SPACK_COMPREPLY=""
fi
@@ -1584,7 +1584,7 @@ _spack_stage() {
_spack_style() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -b --base -a --all -o --output -r --root-relative -U --no-untracked --no-flake8 --no-mypy --black"
+ SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black"
else
SPACK_COMPREPLY=""
fi