Skip to content

Report error for set -v used in blocks/conditions #3122

Open
@kkmuffme

Description

@kkmuffme

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/bin/bash

if [[ "foo" == "$1" ]]
then
        set -v
        echo "hello"
fi

Here's what shellcheck currently says:

No issues detected!

Here's what I wanted or expected to see:

An error that set -v and set +v inside blocks do not have any effect, since this is unexpected, as all (?) other "set" work independently of where they're placed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions