license-scanner icon indicating copy to clipboard operation
license-scanner copied to clipboard

sub `--dir` blacklist

Open jkowalleck opened this issue 3 years ago • 3 comments

I see a CLI parameter --dir which might cause the tool to scan for licenses in a certain directory. I expect the tool traverse also all subdirectories in that directories.

I would love to have an option to omit certain subdirectories and files in arbitrary depth. Maybe exclude via a glob?

Use case examples: scan all files in ./myProject/ but do not traverse any of the following directories: .git, node_modules, vendor, .venv, .pipenv and do not scan files like license.js

structure be like

|- myImages
\- myProject
   |- README.md
   |- .git/...   << ignore 
   |- webUI
   |  |- node_modules/...  << ignore 
   |  |- package.json
   |  |- index.js
   |  |- workspaces
   |  |  \- license
   |  |    |- node_modules/...  << ignore 
   |  |    |- package.json
   |  |    \- license.js        << ignore 
   |  \- LICENSE.mit
   |- serverA
   |  |- LICENSE
   |  \- serve
   |     \- .pipenv/...  << ignore 
   \- serverB
      |- vendor/... << ignore 
      |- composer.json
      |- index.php
      \- License

call could be like license-scanner --dir=./myProject --ignore-glob=node_modules --ignore-glob=vendor --ignore-glob=.git --ignore-glob='.*env' --ignore-glob=license.js

jkowalleck avatar Feb 28 '23 19:02 jkowalleck

Thanks. Absolutely meant to have this as one of our first feature/issue requests. Glad to see you covered files as well as subdirs.

markstur avatar Feb 28 '23 19:02 markstur

TBD: Let's consider what default ignores should be for standard things. Can be set in config.json for easy customizing (with overrides by flags).

markstur avatar Feb 28 '23 19:02 markstur

Let's consider what default ignores should be for standard things

"default ignores" are another story, out of scope of this feature request.

jkowalleck avatar Apr 14 '23 15:04 jkowalleck