Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c78416c
ts: add DejaGnu tool for shell Tab-completion testing
xdelaruelle Aug 8, 2026
c315aea
gh: add completion_tests.yaml, document it in ci.rst
xdelaruelle Aug 8, 2026
ffd830e
Document per-sub-command options in module help usage
xdelaruelle Aug 8, 2026
051b65b
init: remove legacy init* commands from Tab completion candidates
xdelaruelle Aug 8, 2026
e98dc47
Document delete alias in module help usage
xdelaruelle Aug 8, 2026
01f9121
init: add -a/-p option completion for use
xdelaruelle Aug 8, 2026
1e12a5d
Move --ignore-cache/--ignore-user-rc to module help Options section
xdelaruelle Aug 8, 2026
a68d9d2
Document avail/spider/list/stashlist missing options
xdelaruelle Aug 8, 2026
6254eb4
init: add --timer/--redirect/--no-redirect to top-level option comple…
xdelaruelle Aug 8, 2026
d940a3d
Document -d/--delim, --duplicates and --index in module help
xdelaruelle Aug 8, 2026
607ecdf
Add --duplicates/--index to path-family usage synopsis
xdelaruelle Aug 8, 2026
df6a334
init: offer -S/-C completion for list/savelist
xdelaruelle Aug 8, 2026
46f9607
ts: check bash completion against module help ground truth
xdelaruelle Aug 8, 2026
16b4a07
ts: check module/ml argument kind and mirror ground truth for ml
xdelaruelle Aug 8, 2026
934e5f7
init: stop offering -o/--output to savelist completion
xdelaruelle Aug 8, 2026
65119ae
doc: highlight completion/usage-message consistency work in NEWS.rst
xdelaruelle Aug 8, 2026
cea37f6
init: advertise delete alias instead of its del abbreviation
xdelaruelle Aug 9, 2026
26cf894
doc: document remove/delete aliases and prepend option for use
xdelaruelle Aug 10, 2026
b8c7db3
init: complete config sub-command completion with 4 missing options
xdelaruelle Aug 10, 2026
7b252bf
Document --reset in config sub-command usage synopsis
xdelaruelle Aug 10, 2026
3ebc15b
ts: check config sub-command completion against module config ground …
xdelaruelle Aug 10, 2026
cc5efa9
init: complete zsh savelist completion with missing -a/--all
xdelaruelle Aug 10, 2026
f9cce02
ts: check zsh completion, mirroring the bash completion testsuite
xdelaruelle Aug 11, 2026
041beb1
init: remove non-functional -a/--all from is-avail usage and completions
xdelaruelle Aug 11, 2026
10fd31f
init: add missing -f/--force to purge/reload/reset/restore/stash/stas…
xdelaruelle Aug 11, 2026
7e2d996
init: add missing options and completion to source sub-command
xdelaruelle Aug 11, 2026
021111a
doc: document zsh coverage in the completion testsuite
xdelaruelle Aug 11, 2026
c9c7788
ts: check fish completion, mirroring the bash/zsh completion testsuite
xdelaruelle Aug 11, 2026
e1521c5
doc: document fish coverage in the completion testsuite
xdelaruelle Aug 11, 2026
da61564
init: complete option flags for the tcsh 'help' sub-command
xdelaruelle Aug 12, 2026
6b8333c
ts: check tcsh completion, mirroring the bash/zsh/fish completion tes…
xdelaruelle Aug 12, 2026
472fc64
doc: document tcsh coverage in the completion testsuite
xdelaruelle Aug 12, 2026
f7412a6
ts: delete the sandboxed $HOME after the completion testsuite finishes
xdelaruelle Aug 12, 2026
b577cbd
ts: drop the needless fixed wait before every tcsh completion listing
xdelaruelle Aug 12, 2026
44a2ce9
gh: install zsh, fish and tcsh for the completion CI job
xdelaruelle Aug 12, 2026
bbcff04
ts: recognize the zle no-color auto-menu-select redraw in zsh listings
xdelaruelle Aug 12, 2026
954025c
ts: stop relying on fish's own prompt-end marker to detect readiness
xdelaruelle Aug 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[codespell]
# ignore short names used in tests: ans, oT, ue, fo, haa, varius
# ignore short names used in tests: ans, oT, ue, fo, haa, varius, ure
# ignore words joined to \t or \n character: \tThe, \tbe, \nIn
# ignore variable names used in code: desig, matchin, compre, invers, compileTime, seh
# ignore words added to spell check dictionary: lod, nd
# ignore command names used in code: uncomplete
ignore-words-list = ans,ot,ue,fo,haa,varius,tthe,tbe,nin,desig,matchin,compre,invers,compiletime,seh,lod,nd,uncomplete
# ignore hyphenated wording already used throughout Tab completion option
# descriptions: By-pass
ignore-words-list = ans,ot,ue,fo,haa,varius,ure,tthe,tbe,nin,desig,matchin,compre,invers,compiletime,seh,lod,nd,uncomplete,by-pass
# skip git repository internal content
# skip generated content: ChangeLog.gz, doc/build, modulecmd*.tcl, modules.sum
# modules.log, lib/config.sub, lib/config.guess, lib/config.status, lib/configure,
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/completion_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: completion-tests

on:
push:
branches-ignore:
- c-main
- c-3.2
pull_request:

permissions:
contents: read

jobs:
completion-all:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install system packages
run: |
sudo apt-get -y update
sudo apt-get install -y expect-dev dejagnu python3-sphinx gzip bash zsh fish tcsh tcl8.6 python3
# libtclenvmodules build requirements
sudo apt-get install -y gcc autoconf tcl8.6-dev
- name: Build Modules
run: |
./configure
make
- name: Test shell Tab completion
run: |
script/mt comp
- uses: actions/upload-artifact@v7
if: failure()
with:
name: testsuite-logs-${{ github.job }}
path: |
completion.log
retention-days: 5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/install.sum
/lint.log
/lint.sum
/completion.log
/completion.sum
/icdiff
/.noicdiff
/miniconda3
Expand Down Expand Up @@ -54,6 +56,8 @@
/testsuite/example/initrc-1
/testsuite/example/initrc
/testsuite/.config
/testsuite/completion-use-fixture
/testsuite/completion-home
/doc/build
/doc/source/version.py
/doc/demo/*/*.svg
Expand Down
19 changes: 19 additions & 0 deletions .hunspell.en.dic
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CET
CFLAGS
CLICOLOR
CMake
COMPREPLY
CONFIGLIST
ChangeLog
ChemAppA
Expand Down Expand Up @@ -258,9 +259,11 @@ autoreconf
autotools
availabilities
avx
ba
backticks
badcommand
baf
bar1
barbin
basename
basenames
Expand Down Expand Up @@ -297,6 +300,7 @@ chmod
cleanupAndExit
cmake
cmd
cmdline
cmdModule
cmdModuleAliases
cmdModuleAvail
Expand All @@ -314,6 +318,7 @@ cmdModulePath
cmdModulePaths
cmdModuleReset
cmdModuleRestore
cmdModuleSavelist
cmdModuleSearch
cmdModuleStash
cmdModuleStashclear
Expand All @@ -329,11 +334,14 @@ cmdstring
codecov
codespell
collectModuleTag
comgen
commandexp
commandname
compA
compB
compat
compdef
completionhome
compilerTag
compopt
config
Expand All @@ -357,6 +365,7 @@ dbg
de
defaultval
defs
dejagnu
del
delaruelle
delim
Expand Down Expand Up @@ -431,7 +440,9 @@ findModulesInCacheFile
findable
fishcompletiondir
flavour
flatlcompat
flavours
fo
fooA
fooB
foobin
Expand All @@ -441,6 +452,7 @@ formatModuleCacheContent
formatter
foss
fpath
freeform
frontend
fullname
func
Expand Down Expand Up @@ -518,6 +530,7 @@ isdefaultvalue
ismodlo
journalctl
json
keypress
kL
ksh
lappendConf
Expand Down Expand Up @@ -649,6 +662,7 @@ nonpersist
noop
nop
noparse
nospace
notavail
nothreads
notuasked
Expand Down Expand Up @@ -696,6 +710,7 @@ procedure's
procs
ps
pthreads
pty
pushenv
py
pwsh
Expand All @@ -708,6 +723,7 @@ rcp
reStructuredText
readCollectionContent
readModuleContent
readline
readlink
repo
reportError
Expand Down Expand Up @@ -844,6 +860,7 @@ tclxConfig
tcsh
tcshrc
ter
testcompletion
testdir
testfile
testfiles
Expand Down Expand Up @@ -910,6 +927,7 @@ version's
versionadded
versionchanged
versioncmp
versionless
vimdatadir
vimfiles
virt
Expand All @@ -928,6 +946,7 @@ xrdb
xtrace
zA
zipball
zle
zlogin
zsh
zshcompletiondir
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
install-testmodspath-empty install-testmodspath-wild \
install-testmoguicmd uninstall-testconfig uninstall dist dist-tar \
dist-gzip dist-bzip2 dist-win srpm rpm clean distclean test-deps test \
testinstall testlint
testinstall testlint testcompletion

# commands to install files
INSTALL = install
Expand Down Expand Up @@ -1073,6 +1073,13 @@ testlint: initdir modulecmd.tcl $(NAGELFAR) script/add.modules script/modulecmd
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool lint $(RUNTESTFILES)

testcompletion: initdir $(MODULECMD)
TCLSH=$(TCLSH); export TCLSH; \
MODULECMD=$(MODULECMD); export MODULECMD; \
OBJDIR=`pwd -P`; export OBJDIR; \
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool completion $(RUNTESTFILES)


# install enhanced diff tool (to review test results)
icdiff:
Expand Down
17 changes: 17 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ Modules 5.7.0 (not yet released)
* Doc: add :ref:`add-new-hook-event` guide describing how to contribute a
new hook event.
* Doc: add :ref:`sync-remote-appdir` cookbook recipe.
* Testsuite: add *completion* testsuite to validate shell Tab completion of
this project. This testsuite can be invoked with ``make testcompletion`` or
``script/mt comp``. It drives a real bash, zsh, fish or tcsh session
through `Expect <http://expect.sourceforge.net/>`_ to press the Tab key
against the built shell completion script and check the resulting
candidate list.
* Init: fix numerous inconsistencies between ``module help``'s usage message
and the option flags and positional arguments each sub-command actually
accepts, and between that usage message and what bash, fish, tcsh and zsh
Tab completion offer for each sub-command. Guarded against regressing with
a new ground-truth check in the *completion* testsuite that compares
``module``/``ml`` Tab completion against the sub-commands, switches,
options and argument kinds parsed straight out of ``module help``.
* Init: no longer offer the legacy :subcmd:`initadd`, :subcmd:`initclear`,
:subcmd:`initlist`, :subcmd:`initprepend` and :subcmd:`initrm`
sub-commands as Tab completion candidates (bash, fish, tcsh, zsh), since
``module help`` does not document them.


.. _5.6 release notes:
Expand Down
14 changes: 14 additions & 0 deletions doc/source/devel/ci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Overview
pull request.
``lint_tests.yaml``
Static analysis (Nagelfar, ShellCheck). Runs on push, pull request.
``completion_tests.yaml``
Interactive shell Tab-completion tests. Runs on push, pull request.
``differential_shellcheck.yml``
ShellCheck diff annotations on the changed lines only. Runs on pull
request (to ``main``).
Expand Down Expand Up @@ -129,6 +131,18 @@ sh/bash/ksh scripts) via ``script/mt lint``, i.e. the same static analysis
described as the ``lint`` tool in :doc:`testsuite`. On failure it uploads
:file:`lint.log` as a build artifact.

Completion (:file:`completion_tests.yaml`)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Runs the ``completion`` DejaGnu tool (real, Expect-driven Tab-key presses
against the built :file:`init/bash_completion` script) via
``script/mt comp``, i.e. the same interactive shell Tab-completion testing
described as the ``completion`` tool in :doc:`testsuite`. Only needs the
baseline packages (``bash``, ``expect-dev``, ``dejagnu``) rather than the
full multi-shell set installed by :file:`linux_tests.yaml`, since the
``completion.00-init`` layout currently covers bash only. On failure it
uploads :file:`completion.log` as a build artifact.

Differential ShellCheck (:file:`differential_shellcheck.yml`)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
Loading
Loading