Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
487851f
add scaffolding for cyclonedx output plugin #1888
agschrei Jul 30, 2021
799d72d
extract CycloneDX components from codebase packages #1888
agschrei Sep 1, 2021
b9877d6
move external reference mapping into separate function #1888
agschrei Sep 1, 2021
24f64e9
refine mapping of declared_license fields to CycloneDx licenses #1888
agschrei Sep 1, 2021
73f50bc
filter duplicate license entries from output #1888
agschrei Sep 6, 2021
a2a99f1
add custom JSONEncoder #1888
agschrei Sep 6, 2021
8bf7fc7
merge components avoiding duplicates #1888
agschrei Sep 6, 2021
5110639
add indentation to make json output pretty-print #1888
agschrei Sep 6, 2021
9c9c60b
check in expected result for cyclonedx json output #1888
agschrei Sep 6, 2021
bcce29c
add XML serialization #1888
agschrei Sep 6, 2021
f558da8
extract optional scope from dependency tree #1888
agschrei Sep 6, 2021
ac698ad
docs: add cli-reference stub about new output options #1888
agschrei Sep 6, 2021
513c5c8
test: verify removal of None or empty collections #1888
agschrei Sep 7, 2021
3ee1601
handle scan results with empty packages #1888
agschrei Sep 8, 2021
b81a2fd
CHANGELOG: add info about CycloneDx output plugin #1888
agschrei Sep 8, 2021
8346eb8
test: update test_scan_cli_help test resource with new output options…
agschrei Sep 8, 2021
80ff326
replace xml with lxml to allow easy pretty-printing #1888
agschrei Sep 15, 2021
055c951
rename cyclonedx cli options to favor json over xml #1888
agschrei Sep 15, 2021
ef4748e
reorder JSON keys and align with project's coding style #1888
agschrei Sep 15, 2021
1df94fc
apply black formatting without string normalization #1888
agschrei Sep 15, 2021
5d15d30
fix failing test by updating expected result #1888
agschrei Sep 15, 2021
8bf905c
rename variables and reliably extract scancode-toolkit header #1888
agschrei Sep 16, 2021
e633ba6
refactor: turn standalone functions into class methods #1888
agschrei Sep 21, 2021
d26d3b1
map multiple authors and use license db url as fallback #1888
agschrei Sep 21, 2021
9f8d8d4
add external refs for scancode spdx ids #1888
agschrei Sep 22, 2021
da91fee
docs: break lines at 100 chars length to pass lint check #1888
agschrei Sep 23, 2021
93f046a
Merge latest develop branch
pombredanne Dec 24, 2021
7500b64
Sort and streamline imports
pombredanne Dec 24, 2021
4e2526c
Add new build_spdx_license_expression() function
pombredanne Dec 24, 2021
953a40e
Refine CycloneDX support #1888
pombredanne Dec 25, 2021
af286da
Revert change in SDPX tests XML loading
pombredanne Dec 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The following organizations or individuals have contributed to ScanCode:
- Agni Bhattacharyya @PyAgni
- Akanksha Garg @akugarg
- Alex Blekhman @a-tinsmith
- Alexander Gschrei @agschrei
- Armijn Hemmel @armijnhemel
- Arnaud Jeansen @ajeans
- Arnav Mandal @arnav-mandal1234
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Package detection:
Outputs:
~~~~~~~~

- There is a new CycloneDX 1.2 output as XML and JSON.
- Add new outputs for the CycloneDx format.
The CLI now exposes options to produce CycloneDx BOMs in either JSON or XML format


Output version
Expand Down
27 changes: 27 additions & 0 deletions docs/source/cli-reference/output-format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,31 @@ Comparing Different ``json`` Output Formats

----

``--cyclonedx FILE``
--------------------
Scancode also supports the `CycloneDx <https://cyclonedx.org/specification/overview/>`_ output format

Please note that this output format is only useful when scanning with the ``--package`` option

This output format is particularly useful if you want to process ScanCode results
in downstream tools that can't process ScanCode's native JSON output,
but do support CycloneDx BOMs.

To run an example scan on the test resources try:
``./scancode --package --cyclonedx=bom.json tests/formattedcode/data/cyclonedx/simple``

If you prefer XML output over JSON, please have a look at the ``--cyclonedx-xml`` option instead

____

``--cyclonedx-xml FILE``
-------------------------

This option allows outputting CycloneDx BOMs in XML format instead of JSON

To run an example scan on the test resources try:
``./scancode --package --cyclonedx-xml=bom.xml tests/formattedcode/data/cyclonedx/simple``

____

.. include:: /rst_snippets/custom_output_format.rst
6 changes: 6 additions & 0 deletions docs/source/rst_snippets/output_format_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ All Scan Output Options
--html-app FILE Write scan output as a mini HTML
application to FILE.

--cyclonedx FILE Write scan output as a CycloneDx 1.3 BOM
in pretty-printed JSON format to FILE

--cyclonedx-xml FILE Write scan output as a CycloneDx 1.3 BOM
in pretty-printed XML format to FILE

.. include:: /rst_snippets/warning_snippets/output_htmlapp_dep.rst
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ scancode_output =
template = formattedcode.output_html:CustomTemplateOutput
debian = formattedcode.output_debian:DebianCopyrightOutput
yaml = formattedcode.output_yaml:YamlOutput
cyclonedx = formattedcode.output_cyclonedx:CycloneDxJsonOutput
cyclonedx-xml = formattedcode.output_cyclonedx:CycloneDxXmlOutput


[tool:pytest]
Expand Down
Loading