Skip to content

emmylua-check doesn't pick up workspace libraries if they're ignored #683

@mrcjkb

Description

@mrcjkb

Given:

  • A project with the following structure:
.
├── lua
│   └── my-app
│       └── init.lua
├── .luarc.json
├── .lux
│   ├── .gitignore
│   └── 5.1
│       ├── 478a726e64668e552b6e6f7afbbb55aea0ae2eba63fa75b2e0b9d1ebc1639fdb-argparse@0.7.1-1
  • The following .luarc.json:
{
  "workspace": {
    "library": [
      ".lux/5.1/478a726e64668e552b6e6f7afbbb55aea0ae2eba63fa75b2e0b9d1ebc1639fdb-argparse@0.7.1-1",
    ]
  }
}
  • The following --ignore: .lux/**/*

And the following lua/my-app/init.lua:

local argparse = require("argparse")

local parser = argparse("script", "An example.")
parser:rgument("input", "Input file.")
     --^ This should be "argument"

I would expect:

  • emmylua_check to provide an error or a warning for the parser:rgument("input", "Input file.") line

Actual behaviour:

No issues found
Check finished

If I remove the --ignore, emmlua_check outputs warnings and errors for files in the .lux directory (see also #635).

Context:

I'm not actually using the CLI, I'm using it as a library in this PR:

My guess is that this may be a combination of two bugs:

  1. The --ignore prevents the addition of the workspace libraries in the ignored directory.
  2. Without the --ignore, because it's in the project root, emmylua_check treats it as part of the workspace.

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