From ea8cef3849014760facf9e7bf390db30d7855ddf Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:11:45 +0100 Subject: [PATCH 1/2] fix: do not overwrite user-provided shellcheck `--shell` (#1064) --- server/src/shellcheck/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/shellcheck/index.ts b/server/src/shellcheck/index.ts index 5f4f207bf..c526d0b9f 100644 --- a/server/src/shellcheck/index.ts +++ b/server/src/shellcheck/index.ts @@ -120,13 +120,19 @@ export class Linter { .map((folderName) => `--source-path=${folderName}`) const args = [ - `--shell=${shellName}`, '--format=json1', '--external-sources', ...sourcePathsArgs, ...additionalArgs, ] + // only add `--shell` argument if non is provided by the user in their + // config. This allows to the user to override the shell. See #1064. + const userArgs = additionalArgs.join(' ') + if (!(userArgs.includes('--shell') || userArgs.includes('-s '))) { + args.unshift(`--shell=${shellName}`) + } + logger.debug(`ShellCheck: running "${this.executablePath} ${args.join(' ')}"`) let out = '' From 5164c633e576feca843520ab5ff1a49898637b90 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhus Date: Fri, 3 Jan 2025 00:15:43 +0100 Subject: [PATCH 2/2] chore: prepare for 5.4.3 release --- server/CHANGELOG.md | 4 ++++ server/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/CHANGELOG.md b/server/CHANGELOG.md index a63bd7d0d..bac5252bb 100644 --- a/server/CHANGELOG.md +++ b/server/CHANGELOG.md @@ -1,5 +1,9 @@ # Bash Language Server +## 5.4.3 + +- Do not overwrite user-provided shellcheck `--shell` argument https://github.com/bash-lsp/bash-language-server/pull/1133 + ## 5.4.2 - Fix wrong pnpm engine version diff --git a/server/package.json b/server/package.json index 2aab9512e..619815094 100644 --- a/server/package.json +++ b/server/package.json @@ -3,7 +3,7 @@ "description": "A language server for Bash", "author": "Mads Hartmann", "license": "MIT", - "version": "5.4.2", + "version": "5.4.3", "main": "./out/server.js", "typings": "./out/server.d.ts", "bin": {