Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local nimbledeps folder is not included when linting imports #89

Open
gtdrakeley opened this issue Apr 22, 2022 · 3 comments
Open

local nimbledeps folder is not included when linting imports #89

gtdrakeley opened this issue Apr 22, 2022 · 3 comments

Comments

@gtdrakeley
Copy link

If you are using nimble with the --localdeps flag to keep dependencies local to a project they are not included when linting the files.

As a result nimble build will function as expected but you will have import errors in any source file using installed dependencies.

@gtdrakeley
Copy link
Author

Investigated a bit further and it would probably be sufficient to:

  • call nimble list --installed to get a list of installed packages
  • for each one execute nimble path <pkg> to get their path
  • for each path, add a --path:<path> option to the call to nim check or any other tools that need to know the location of installed packages

@saem
Copy link
Owner

saem commented Apr 25, 2022

Could you achieve the same thing with a cfg file? The extension uses nimsuggest, which is essentially the compiler. If anything Nimble should generate a workable cfg.

Nimble and I aren't friends; I tried to deeply incorporate it in the past. You've got an overall approach, if you can make a clean addition I'll accept the PR. Sorry, I can't even begin to imagine spending any more of my time on that thing.

@johanobergman
Copy link

You can add --NimblePath: "./nimbledeps/pkgs" for Nim 1 and --NimblePath: "./nimbledeps/pkgs2" for Nim 2 to nim.cfg. This enables linting for locally installed dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants