Repository navigation
v0.4.0
shell-lsp 0.4.0 is about understanding and steering the linter from the
editor: diagnostics explain themselves on hover, you can see which shell a
file is linted as and switch it, choose how strict linting is with one
setting, and fix or ignore a check across a file or the whole workspace.
Highlights
- Diagnostics explain themselves: hovering a finding shows its severity,
a one-line summary, a before/after preview of its fix marked safe or for
review, how to silence it, and links to its entry in
docs/checks.md
or docs/rules.md
and the ShellCheck wiki. Diagnostic codes link to those docs in editors
that support it. - See and switch the shell: VS Code's status bar shows the shell a file is
linted as and what decided it ("from the shebang #!/usr/bin/env bash",
"guessed from the .sh extension"). Clicking it switches the shell by
writing a# shellcheck shell=directive, which every editor and
shell-lsp checkhonour. Other editors can ask the server through the new
shellLsp/documentDialectandshellLsp/setDialectrequests; a Neovim
statusline snippet is in
docs/editors.md. lint.profile:minimalkeeps errors, warnings and the notes that
point at real bugs;recommended(the default) is unchanged;strict
turns on the optional checks.shell-lsp check --profiledoes the same.
Explicitlint.exclude,lint.optionaland directives still win.- Per-check actions on a diagnostic: fix every finding of that check in
the file, ignore it in the file (merged into the header'sdisable=
line), or ignore it in the workspace (added to the nearest
.shellcheckrc, created at the folder root if needed, after
confirmation).
Changes
- The editor now applies the nearest
.shellcheckrc(including
~/.shellcheckrcand$XDG_CONFIG_HOME/shellcheckrc) the way
shell-lsp checkdoes: itsdisable,enableandextended-analysis
settings affect diagnostics, a broken file is reported by name, and edits
to it are picked up. Itsshell=andsource-path=are still read only by
the command line. - A new
# shellcheck shell=line is inserted after the existing header
directives instead of directly after the shebang. - VS Code's generic
shellscriptlanguage no longer counts as naming the
shell, so a file without a shebang is shown as a guess.
Install
Release binaries for Linux, macOS and Windows (amd64, arm64) with
SHA256SUMS are attached below. Alternatively
go install github.com/stubbedev/shell-lsp@v0.4.0 or
nix profile install github:stubbedev/shell-lsp. For VS Code, install the
Shell LSP extension, or shell-lsp-0.4.0.vsix below. Editor setup:
docs/editors.md.
Known limitations
.shellcheckrcfiles get no completion or hover, because editors do not
send them to language servers.