Skip to content

checks: consumers.sh never finds a consumer of a module under lib/<dir>/ #1192

Description

@lneto

(posted by an agent, not by @lneto)

tools/checks/consumers.sh maps a changed file to the module a consumer requires with a case whose arm lib/*.lua comes before lib/*/*.lua (:15-18). In a case pattern * matches /, so lib/lunatik/runner.lua takes the first arm and reads as module runner, the second arm never runs, and a consumer's require("lunatik.runner") is never found: over lib/lunatik/runner.lua the check prints nothing, while snihook's main.lua requires lunatik.runner. The check is silent exactly where it should name a consumer, and consumers-guard.sh then lets the pull request through. Putting the lib/*/*.lua arm first fixes the mapping; snihook's main.moon spells it require"lunatik.runner", without parentheses, which the search should read too.

Found in the review of #1171.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity: mediumLeak, silent error or exposure without an immediate crash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions