repo_info_extractor icon indicating copy to clipboard operation
repo_info_extractor copied to clipboard

Exclude popular dependency directories

Open peti2001 opened this issue 5 years ago • 2 comments

In some repositories, the dependencies are also included. With a simple string matching in the path we can exclude them. eg:

  • node_modules (node.js)
  • vendor (Go)
  • etc

peti2001 avatar Aug 24 '20 06:08 peti2001

For JS, files containing min or dist in their path are also affected. yarn v2 (aka berry) advises to commit ca. 2MB of its direct .js dependencies into version control as well, changing with each version. It's located in the .yarn folder and in the root (.pnp.js or .pnp.*). vendor will also cover PHP composer default.

matfax avatar Aug 31 '20 10:08 matfax

I gave it another thought. There might be more paths than one might expect. As I noticed, you already detect .gitignore properly. There is this complete list of gitignore templates that could be mapped to the existing set of languages. These templates contain all files that need to be considered, given any common language. It could be imported as a git submodule and then, the .gitignore file could be extended or created so that it reflects the initially detected languages.

matfax avatar Aug 31 '20 10:08 matfax