-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
the --ignore behaviour needs refinement #726
Comments
@pombredanne Can you please elaborate with an example to make things a bit lucid ? |
@yash-nisar not sure exactly in fact. May you can come with some tests to see if this always works more or less like with .gitignore? |
+1 on this one... Use case: one of our projects (a Go + NPM combination) includes the npm package Besides that, I'd like to exclude minified CSS files because they return the whole file instead of only the matched license text (because of the missing line breaks). The same license info is also in the non-minified files, so I'm not missing anything there by doing that... And finally, the build and test process results in a few (intermediate/final) output files, which I'd like to ignore as well. So ideally, my ignores would look something like: scancode -clpi --json-pp $SCANRESULTSFILE --license-text -n 4 --consolidate \
--summary --filter-clues --is-license-text \
--ignore "controller/.wwhrd.yml" \
--ignore "controller/.testCoverage.txt" \
--ignore "controller/coverage.html" \
--ignore "controller/coverage_by_function.txt" \
--ignore "controller/.testOutput.txt" \
--ignore "controller/.coverage.tmp" \
--ignore "controller/controller" \
--ignore "app/build/*" \
--ignore "app/node_modules/spdx-license-list/licenses/*" \
--ignore "app/node_modules/spdx-license-list/spdx*.json" \
--ignore "app/node_modules/type-detect/package.json" \
--ignore "*.min.css" \
--ignore "*.js.map" \
--ignore "*.mjs.map" \
controller app Needless to say that this currently doesn't work, the |
@mtenberge thanks for the details! I reckon this has been surprisingly hard to get these ignores right. |
Thanks for your response. The possibility of an ignore file, with comparable functionality to e.g. As an alternative for a full-fledged implementation of includes, excludes and config files and the corresponding include/exclude logic, maybe it would be easier to accept a list of files to be scanned from a file? This would allow existing powerful utilities, such as Scancode can already accept a list of to-be-scanned files/directories on its command line, but this can't be used for a large number of files, because the length of the command line is limited. |
Wouldn't it make sense to allow specification of an ignore file with the same syntax as a .gitignore file (which incidentally is the same as dockerignore and some other ignore formats). There are cases where you want to scan a checked out git repo that you might have already run some builds on however and that is therefore full of files that aren't really part of the package anyway. |
@Blackclaws re:
Yes 100% agree. This exactly what we want to have. There has been some work towards enabling this with aboutcode-org/commoncode#42 |
The glob patterns are applied to each path segment making it impossible to ignore a path with more than one segment. It should instead be applied to the whole path at once which would be more useful and intuitive.
The text was updated successfully, but these errors were encountered: