Support multiple input path in CLI #875 #1397 - #1399
Conversation
|
@nicobucher ping... were you able to test this branch a bit? feedback is mucho welcomed! |
|
Hi @pombredanne, I was able to quickly try this out. I will play around with this branch in the next days. Perhaps I can give more detailed feedback then. |
|
@nicobucher thank you for the feedback. Note that the current implementation is subpar performance wise because the logic goes this way:
If you have a large codebase (say a Linux kernel) and you modified only one file, this would walk 70K files first. So this can be optimized later if needed. |
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
The handling of ignores and includes/excludes was not fully correct and precedence was not given to includes Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This was ScanCode can be aclled as a simple function without the Click UI/UX and requirements Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
See ticket #1400 for more details This is an example of how to call Scancode as a function from Python2 or Python3. The benefits are that when the server process has loaded the license index, and imported its modules there is no per-call import/loading penalty anymore. This is using execnet which is the multiprocessing library used by py.test and therefore a rather stable and high quality engine. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
767ef38 to
8afa686
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1399 +/- ##
===========================================
+ Coverage 83.65% 83.83% +0.17%
===========================================
Files 119 119
Lines 13949 14245 +296
===========================================
+ Hits 11669 11942 +273
- Misses 2280 2303 +23
Continue to review full report at Codecov.
|
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This can be a list or tuple or a string. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
e0096b3 to
96069fd
Compare
|
@johnmhoran I moved the script to create one SPDX doc per license to this branch... https://github.com/nexB/scancode-toolkit/pull/1399/files#diff-09a4d8eb1415f0acf8c0e24ec59fc3d3 |
|
Thanks for the heads-up @pombredanne . |
|
All green ... merging now. |
This adds support for #875 #1397 aka. multiple inputs and a new
--includeoption.--includethat works in tandem with the--ignoreand has the same semantics. Includes are processed first then ignores are applied on top.find samples/ | grep zlib |grep -v ada | grep -v iostrea | xargs scancode --include="*JGroup*" --ignore "*.S" --json-pp -or this:
git diff --name-only master | xargs scancode -i --json-pp -Reported-by: Nico Bucher @nicobucher
Signed-off-by: Philippe Ombredanne pombredanne@nexb.com