question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Symlinked files are ignored

See original GitHub issue

depcheck does not process source files that are symlinked to a file outside the package being analyzed.

This is simple to repro:

  1. Create a new package with a blank package.json
  2. Add a js file where the only line is var test = require('lodash');
  3. Running depcheck on that package properly shows that the dependency lodash is missing
  4. Move the js file somewhere outside the package and symlink to it inside the package
  5. depcheck reports no issues

I found the problematic code: only regular files (the type ‘file’) are checked. This group does not include the ‘link’ category, which contains the symlinks in question. That’s why they’re ignored.

Context: the reason I have to worry about symlinks is that I’m using this within a bazel build system, which symlinks groups of source files to sandbox environments where tests run.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
magilljcommented, Aug 31, 2018

Sure I might be able to give it a shot within the next couple weeks

0reactions
mzyilcommented, May 9, 2019

I’m planning to open a PR anyway, I will see what I can do

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telling git to ignore symlinks - Stack Overflow
If you really want to ignore a filename if it's a symlink or file but not if it is a directory, you can...
Read more >
ebignore includes symlinked files in ignored directories #69
With an eb application and environment set up - where the project contains a directory called ignore and, within that, one standard directory ......
Read more >
gitignore Documentation - Git
DESCRIPTION. A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES ......
Read more >
git ignore symlink folder
Ignored files are tracked in a special file named.gitignorethat is checked in at the root of your repository. There is no explicit git...
Read more >
gitignore - Specifies intentionally untracked files to ignore
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found