Skip to content

The "shell" directive has no effect in a shell script file #929

Closed
@sprat

Description

@sprat

Code editor

Sublime Text

Platform

Windows, Linux

Version

5.0.0

What steps will reproduce the bug?

The following script raises a shellcheck warning on the "set" line:

#!/bin/sh
# shellcheck shell=ash
set -euxo pipefail

However it should not because I explicitly defined the shell to eliminate the warning.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

I would expect the shell directive to be taken into account, so no warning should appear on the "set" line

What do you see instead?

The shell directive is ignored

Additional information

I suspect that the problem is caused by the LSP language server passing the --shell option to the command-line which have the priority over the shell directive defined in my script file. But, AFAIK, there's no way to change/remove the value of the --shell option, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions