Skip to content

Commit 8745ca0

Browse files
Merge branch 'develop' into add-doc-link-to-readme
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
2 parents b0fbe1a + af53895 commit 8745ca0

123 files changed

Lines changed: 335753 additions & 13203 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ matrix:
7878
python: "3.6"
7979
dist: bionic
8080

81+
- os: linux
82+
sudo: required
83+
script:
84+
- source bin/activate
85+
- cd docs
86+
- ./scripts/sphinx_build_link_check.sh
87+
- ./scripts/doc8_style_check.sh
88+
language: python
89+
python: "3.6"
90+
dist: bionic
8191

8292
addons:
8393
homebrew:
@@ -102,11 +112,6 @@ script:
102112
# - ./bin/py.test -n 2 -vvs --cov=src tests/scancode
103113
# - echo $TEST_SUITE
104114
- $TEST_SUITE
105-
# Documentation Test Scripts
106-
- source bin/activate
107-
- cd docs
108-
- "./scripts/sphinx_build_link_check.sh"
109-
- "./scripts/doc8_style_check.sh"
110115

111116
# Pay attention to both calls below. They will succeed even if there
112117
# is no coverage information or connection to reporting website fails.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.. _cpp_includes_plugin:
2+
3+
CPP Includes Plugin
4+
===================
5+
6+
This plugin allows users to collect the #includes statements in C/C++ files.
7+
8+
Using the Plugin
9+
----------------
10+
11+
User needs to use the ``--cpp-includes`` option.
12+
13+
The following command will collect the #includes statements from C/C++ files.::
14+
15+
$ scancode --cpp-includes /path/to/codebase/ --json-pp ~/path/to/scan-output.json
16+
17+
Example Output
18+
--------------
19+
20+
Here is an sample output::
21+
22+
{
23+
"path": "zlib_deflate/deflate.c",
24+
"type": "file",
25+
"cpp_includes": [
26+
"<linux/module.h",
27+
"<linux/zutil.h",
28+
"\"defutil.h"
29+
],
30+
"scan_errors": []
31+
},
32+
{
33+
"path": "zlib_deflate/deflate_syms.c",
34+
"type": "file",
35+
"cpp_includes": [
36+
"<linux/module.h",
37+
"<linux/init.h",
38+
"<linux/zlib.h"
39+
],
40+
"scan_errors": []
41+
}

docs/source/plugins/dwarf.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _dwarf_plugin:
2+
3+
Dwarf Plugin
4+
============
5+
6+
This plugin allows users to collect source code path/name from compilation units found in
7+
ELF DWARFs.
8+
9+
Specification
10+
-------------
11+
12+
This plugin will only work with non-stripped ELFs with debug symbols.
13+
14+
Using the Plugin
15+
----------------
16+
17+
User needs to use the ``--dwarf`` option.
18+
19+
The following command will collect all the dwarf references found in non-stripped ELFs::
20+
21+
$ scancode --dwarf /path/to/codebase/ --json-pp ~/path/to/scan-output.json
22+
23+
Example Output
24+
--------------
25+
26+
Here is an sample output::
27+
28+
{
29+
"path": "project/stripped.ELF",
30+
"type": "file",
31+
"dwarf_source_path": [],
32+
"scan_errors": []
33+
},
34+
{
35+
"path": "project/non-stripped.ELF",
36+
"type": "file",
37+
"dwarf_source_path": ['/tmp/test.c],
38+
"scan_errors": []
39+
}

docs/source/plugins/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
plugin_arch
88
licence_policy_plugin
99
plugin_tutorials
10+
cpp_includes_plugin
11+
lkmclue
12+
dwarf

docs/source/plugins/lkmclue.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.. _lkmclue_plugin:
2+
3+
LKMClue Plugin
4+
==============
5+
6+
This plugin allows users to collect LKM module clues and type indicating a
7+
possible Linux Kernel Module.
8+
9+
Using the Plugin
10+
----------------
11+
12+
User needs to use the ``--lkmclue`` option.
13+
14+
The following command will collect the LKM module clues from the input location::
15+
16+
$ scancode --lkmclue /path/to/codebase/ --json-pp ~/path/to/scan-output.json
17+
18+
Example Output
19+
--------------
20+
21+
Here is an sample output::
22+
23+
{
24+
"path": "zlib_deflate/deflate.c",
25+
"type": "file",
26+
"lkm_clue": {
27+
"lkm-header-include": [
28+
"include <linux/module.h>"
29+
]
30+
},
31+
"scan_errors": []
32+
},
33+
{
34+
"path": "zlib_deflate/deflate_syms.c",
35+
"type": "file",
36+
"lkm_clue": {
37+
"lkm-header-include": [
38+
"include <linux/module.h>"
39+
],
40+
"lkm-license": [
41+
"GPL"
42+
]
43+
},
44+
"scan_errors": []
45+
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def read(*names, **kwargs):
293293
'classify-package = summarycode.classify:PackageTopAndKeyFilesTagger',
294294
'is-license-text = licensedcode.plugin_license_text:IsLicenseText',
295295
'filter-clues = cluecode.plugin_filter_clues:RedundantCluesFilter',
296-
'consolidate = scancode.plugin_consolidate:Consolidator',
296+
'consolidate = summarycode.plugin_consolidate:Consolidator',
297297
],
298298

299299
# scancode_output_filter is the entry point for filter plugins executed

src/packagedcode/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ def purl(self):
241241
"""
242242
Return a compact purl package URL string.
243243
"""
244+
if not self.name:
245+
return
244246
return PackageURL(
245247
self.type, self.namespace, self.name, self.version,
246248
self.qualifiers, self.subpath).to_string()
@@ -323,7 +325,8 @@ class DependentPackage(BaseModel):
323325
purl = String(
324326
repr=True,
325327
label='Dependent package URL',
326-
help='A compact purl package URL')
328+
help='A compact purl package URL. Typically when there is an unresolved requirement, there is no version. '
329+
'If the dependency is resolved, the version should be added to the purl')
327330

328331
requirement = String(
329332
repr=True,

0 commit comments

Comments
 (0)