Skip to content

SC2329 - false positive when passing function to another function #3363

@mkp76

Description

@mkp76

For bugs with existing features

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

#!/bin/bash

function foo1() {
	local fn=${1}
	echo "foo1"
	${fn}
}

function foo2() {
	echo "foo2"
	return 0
}

foo1 foo2

exit  0

Here's what shellcheck currently says:

Line 9:
function foo2() {
^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly).

Here's what I wanted or expected to see:

No issue

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