Skip to content

Commit d70c323

Browse files
Fix pip and python 3 support
This commit adds support for pip install and Python 3 install methods. Also standardizes scan commands across the docs. Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 6dbe59f commit d70c323

21 files changed

Lines changed: 336 additions & 160 deletions

docs/source/scancode-toolkit/cli-reference/basic-options.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55

66
----
77

8+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
9+
10+
----
11+
812
``--generated`` Options
913
-----------------------
1014

1115
The ``--generated`` option classifies automatically generated code files with a flag.
1216

1317
An example of using ``--generated`` in a scan::
1418

15-
./scancode -clpieu --json-pp output.json samples --generated
19+
scancode -clpieu --json-pp output.json samples --generated
1620

1721
In the results, for each file the following attribute is added with it's corresponding
1822
``true``/``false`` value ::
@@ -47,7 +51,7 @@
4751

4852
An example usage::
4953

50-
./scancode -clpieu --json-pp output.json samples --max-email 5
54+
scancode -clpieu --json-pp output.json samples --max-email 5
5155

5256
This only reports 5 email addresses per file and ignores the rest.
5357

@@ -71,7 +75,7 @@
7175

7276
An example usage::
7377

74-
./scancode -clpieu --json-pp output.json samples --max-url 10
78+
scancode -clpieu --json-pp output.json samples --max-url 10
7579

7680
This only reports 10 urls per file and ignores the rest.
7781

@@ -100,7 +104,7 @@
100104

101105
An example usage::
102106

103-
./scancode -clpieu --json-pp output.json samples --license-score 70
107+
scancode -clpieu --json-pp output.json samples --license-score 70
104108

105109
Here's the license results on setting the integer value to 100, Vs. the default value 0. This is
106110
visualized using ScanCode workbench in the License Info Dashboard.
@@ -134,7 +138,7 @@
134138

135139
An example Scan::
136140

137-
./scancode -cplieu --json-pp output.json samples --license-text
141+
scancode -cplieu --json-pp output.json samples --license-text
138142

139143
An example matched text included in the results is as follows::
140144

@@ -178,7 +182,7 @@
178182

179183
A scan example using the ``--license-url-template TEXT`` option ::
180184

181-
./scancode -clpieu --json-pp output.json samples --license-url-template https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/{}.yml
185+
scancode -clpieu --json-pp output.json samples --license-url-template https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/{}.yml
182186

183187
In a normal scan, reference url for "ZLIB License" is as follows::
184188

@@ -212,7 +216,7 @@
212216

213217
An example Scan::
214218

215-
./scancode -cplieu --json-pp output.json samples --license-text --license-text-diagnostics
219+
scancode -cplieu --json-pp output.json samples --license-text --license-text-diagnostics
216220

217221
Running a scan on the samples directory with ``--license-text --license-text-diagnostics`` options,
218222
causes the following difference in the scan result of the file

docs/source/scancode-toolkit/cli-reference/core-options.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
----
99

10+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
11+
12+
----
13+
1014
Comparing Progress Message Options
1115
----------------------------------
1216

@@ -89,7 +93,7 @@ Comparing Progress Message Options
8993

9094
An example scan command using ``--from-json``::
9195

92-
./scancode --from-json sample.json --json-pp sample_2.json --classify
96+
scancode --from-json sample.json --json-pp sample_2.json --classify
9397

9498
This inputs the scan results from ``sample.json``, runs the post-scan plugin ``--classify`` and
9599
outputs the results for this scan to ``sample_2.json``.
@@ -114,4 +118,4 @@ Comparing Progress Message Options
114118

115119
An example usage::
116120

117-
./scancode -clieu --json-pp sample.json samples --max-in-memory -1
121+
scancode -clieu --json-pp sample.json samples --max-in-memory -1

docs/source/scancode-toolkit/cli-reference/help-text-options.rst

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,11 @@ displays basic usage, and some simple examples. The command line option for this
2020

2121
You can also use the shorter ``-h`` option, which does the same.
2222

23-
For Linux based systems the full command is::
24-
25-
$ ./scancode --help
26-
27-
And for windows, it will be like::
23+
To see the help text from the Terminal, execute the following command::
2824

2925
$ scancode --help
3026

31-
.. note::
32-
33-
Make sure you are in the Scancode Root Directory before carrying out this command. After
34-
extracting the ``.zip`` or ``.tar.bz`` file, the folder for Scancode-Toolkit version 3.1.1
35-
will be named like "scancode-toolkit-3.1.1".
27+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
3628

3729
The Following Help Text is displayed, i.e. This is the help text for Scancode Version 3.1.1 ::
3830

@@ -235,14 +227,12 @@ of code scanning:
235227

236228
The command line option for displaying these basic examples is ``--examples``.
237229

238-
For Linux based systems the full command is::
239-
240-
$ ./scancode --examples
241-
242-
And for windows, it will be like::
230+
To see the help text from the Terminal, execute the following command::
243231

244232
$ scancode --examples
245233

234+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
235+
246236
The Following Text is displayed, i.e. This is the examples for Scancode Version 3.1.1 ::
247237

248238
Scancode command lines examples:
@@ -311,14 +301,12 @@ The command line option for displaying all the plugins is:
311301

312302
- ``--plugins``
313303

314-
For Linux based systems the full command is::
315-
316-
$ ./scancode --plugins
317-
318-
And for windows, it will be like::
304+
To see the help text from the Terminal, execute the following command::
319305

320306
$ scancode --plugins
321307

308+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
309+
322310
.. note::
323311

324312
Plugins that are shown by using ``--plugins`` include the following:
@@ -772,7 +760,7 @@ This option prints the options selected for one specific scan command.
772760

773761
If we run this command::
774762

775-
./scancode -clpieu --json-pp sample.json samples --classify --summary --summary-with-details --print-options
763+
scancode -clpieu --json-pp sample.json samples --classify --summary --summary-with-details --print-options
776764

777765
The output will be::
778766

docs/source/scancode-toolkit/cli-reference/list-options.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ There's also another section for ``extractcode`` options.
1818
The order of the sections and all their options is the same as in the :ref:'cli_help_text',
1919
available in the command line.
2020

21+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
22+
2123
.. _cli_basic:
2224

2325
.. include:: /scancode-toolkit/rst_snippets/basic_options.rst

docs/source/scancode-toolkit/cli-reference/output-filters-and-control.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Controlling Scancode Output and Filters
77

88
----
99

10+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
11+
12+
----
13+
1014
``--strip-root`` Vs. ``--full-root``
1115
------------------------------------
1216

@@ -17,7 +21,7 @@ Controlling Scancode Output and Filters
1721

1822
::
1923

20-
./scancode -cplieu --json-pp output.json samples --full-root
24+
scancode -cplieu --json-pp output.json samples --full-root
2125

2226
These two changes only the "path" attribute of the file information. For this comparison we
2327
compare the "path" attributes of the file ``LICENSE`` inside ``JGroups`` directory.
@@ -53,7 +57,7 @@ Controlling Scancode Output and Filters
5357

5458
This scan ignores all files with authors matching the string "Apache Software Foundation"::
5559

56-
./scancode -cplieu --json-pp output.json samples --ignore-author "Apache Software Foundation"
60+
scancode -cplieu --json-pp output.json samples --ignore-author "Apache Software Foundation"
5761

5862
More information on :ref:`glob_pattern_matching`.
5963

@@ -71,7 +75,7 @@ Controlling Scancode Output and Filters
7175

7276
This scan ignores all files with Copyright Holders matching the string "Free Software Foundation"::
7377

74-
./scancode -cplieu --json-pp output.json samples --ignore-copyright-holder "Free Software Foundation"
78+
scancode -cplieu --json-pp output.json samples --ignore-copyright-holder "Free Software Foundation"
7579

7680
More information on :ref:`glob_pattern_matching`.
7781

@@ -86,7 +90,7 @@ Controlling Scancode Output and Filters
8690

8791
An example Scan::
8892

89-
./scancode -cplieu --json-pp output.json samples --only-findings
93+
scancode -cplieu --json-pp output.json samples --only-findings
9094

9195
.. note::
9296

docs/source/scancode-toolkit/cli-reference/output-format.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ following options.
1212

1313
----
1414

15+
.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst
16+
17+
----
18+
1519
.. _output_to_stdout:
1620

1721
.. include:: /scancode-toolkit/rst_snippets/stdout.rst
@@ -30,7 +34,7 @@ following options.
3034
The following code performs a scan on the samples directory, and publishes the results in
3135
``json`` format::
3236

33-
./scancode -clpieu --json output.json samples
37+
scancode -clpieu --json output.json samples
3438

3539
.. include:: /scancode-toolkit/rst_snippets/note_snippets/output_json_ugly.rst
3640

@@ -144,7 +148,7 @@ following options.
144148
The following code performs a scan on the samples directory, and publishes the results in
145149
``json-pp`` format::
146150

147-
./scancode -clpieu --json-pp output.json samples
151+
scancode -clpieu --json-pp output.json samples
148152

149153
A sample JSON output for an individual file will look like::
150154

@@ -247,7 +251,7 @@ following options.
247251
The following code performs a scan on the samples directory, and publishes the results in
248252
``json-lines`` format::
249253

250-
./scancode -clpieu --json-lines output.json samples
254+
scancode -clpieu --json-lines output.json samples
251255

252256
Here is a sample line from a report generated by the ``jsonlines`` format::
253257

@@ -342,7 +346,7 @@ Comparing Different ``json`` Output Formats
342346
The following code performs a scan on the samples directory, and publishes the results in
343347
``spdx-rdf`` format::
344348

345-
./scancode -clpieu --spdx-rdf output.spdx samples
349+
scancode -clpieu --spdx-rdf output.spdx samples
346350

347351
Learn more about SPDX specifications `here <https://spdx.org/specifications>`_ and in this GitHub
348352
`repository <https://github.com/spdx/spdx-spec>`_.
@@ -363,7 +367,7 @@ Comparing Different ``json`` Output Formats
363367
The following code performs a scan on the samples directory, and publishes the results in
364368
``spdx-tv`` format::
365369

366-
./scancode -clpieu --spdx-tv output.spdx samples
370+
scancode -clpieu --spdx-tv output.spdx samples
367371

368372
A SPDX-TV file starts with::
369373

@@ -431,7 +435,7 @@ Comparing Different ``json`` Output Formats
431435
The following code performs a scan on the samples directory, and publishes the results in
432436
HTML format::
433437

434-
./scancode -clpieu --html output.html samples
438+
scancode -clpieu --html output.html samples
435439

436440
The HTML page generated has these following Tables:
437441

@@ -457,10 +461,12 @@ Comparing Different ``json`` Output Formats
457461
ScanCode also supports formatting the output in a HTML visualization tool, which is more
458462
helpful than the standard HTML format.
459463

464+
.. include:: /scancode-toolkit/rst_snippets/warning_snippets/output_htmlapp_dep.rst
465+
460466
The following code performs a scan on the samples directory, and publishes the results in
461467
``html-app`` format::
462468

463-
./scancode -clpieu --csv output.html samples
469+
scancode -clpieu --csv output.html samples
464470

465471
The Files scanned are shown in the left sidebar, and the section on the right contains separate
466472
tabs for the following:
@@ -476,8 +482,6 @@ Comparing Different ``json`` Output Formats
476482

477483
.. include:: /scancode-toolkit/rst_snippets/note_snippets/output_htmlapp_search.rst
478484

479-
.. include:: /scancode-toolkit/rst_snippets/warning_snippets/output_htmlapp_dep.rst
480-
481485
.. figure:: data/output_html_app1.png
482486

483487
.. figure:: data/output_html_app2.png
@@ -494,7 +498,7 @@ Comparing Different ``json`` Output Formats
494498
The following code performs a scan on the samples directory, and publishes the results in
495499
``csv`` format::
496500

497-
./scancode -lpceiu --csv sample.csv samples
501+
scancode -lpceiu --csv sample.csv samples
498502

499503
The first line of the csv file contains the headings, and they are:
500504

0 commit comments

Comments
 (0)