CycloneDX / CycloneDX/license-scanner

sub `--dir` blacklist

Open
#10 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
55
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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](https://en.wikipedia.org/wiki/Glob_(programming))?

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
```text
|- 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.