Skip to content

Commit da98250

Browse files
authored
Merge pull request #3104 from nexB/prep-release-31-2
Prepare release 31.2
2 parents 566baa5 + 1e41310 commit da98250

File tree

813 files changed

+11540
-941
lines changed

Some content is hidden

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

813 files changed

+11540
-941
lines changed

.github/workflows/about-files-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI About Files
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read # to fetch code (actions/checkout)
7+
58
jobs:
69
build:
710
runs-on: ubuntu-20.04

.github/workflows/docs-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI Documentation
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read # to fetch code (actions/checkout)
7+
58
jobs:
69
build:
710
runs-on: ubuntu-20.04

.github/workflows/scancode-release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ on:
1717
tags:
1818
- "v*.*.*"
1919

20+
permissions: {}
2021
jobs:
2122

2223
build_scancode_for_pypi:
24+
permissions:
25+
contents: read # to fetch code (actions/checkout)
26+
2327
name: Build PyPI archives
2428
runs-on: ubuntu-20.04
2529

@@ -67,6 +71,9 @@ jobs:
6771

6872

6973
build_scancode_for_release_linux:
74+
permissions:
75+
contents: read # to fetch code (actions/checkout)
76+
7077
name: Build Release for linux
7178
runs-on: ubuntu-20.04
7279
needs:
@@ -106,6 +113,9 @@ jobs:
106113

107114

108115
build_scancode_for_release_macos:
116+
permissions:
117+
contents: read # to fetch code (actions/checkout)
118+
109119
name: Build Release for mac
110120
runs-on: ubuntu-20.04
111121
needs:
@@ -145,6 +155,9 @@ jobs:
145155

146156

147157
build_scancode_for_release_windows:
158+
permissions:
159+
contents: read # to fetch code (actions/checkout)
160+
148161
name: Build Release for windows
149162
runs-on: ubuntu-20.04
150163
needs:
@@ -183,6 +196,9 @@ jobs:
183196

184197

185198
build_scancode_for_release_source:
199+
permissions:
200+
contents: read # to fetch code (actions/checkout)
201+
186202
name: Build source
187203
runs-on: ubuntu-20.04
188204
needs:
@@ -221,6 +237,9 @@ jobs:
221237

222238

223239
smoke_test_install_and_run_pypi_dists_posix:
240+
permissions:
241+
contents: read # to fetch code (actions/checkout)
242+
224243
name: Test POSIX PyPI wheels
225244
needs:
226245
- build_scancode_for_pypi
@@ -267,6 +286,9 @@ jobs:
267286
268287
269288
smoke_test_install_and_run_pypi_dists_windows:
289+
permissions:
290+
contents: read # to fetch code (actions/checkout)
291+
270292
name: Test Windows PyPI wheels
271293
needs:
272294
- build_scancode_for_pypi
@@ -312,6 +334,9 @@ jobs:
312334
313335
314336
smoke_test_install_and_run_app_archives_on_linux:
337+
permissions:
338+
contents: read # to fetch code (actions/checkout)
339+
315340
name: Test app on ${{ matrix.os }}
316341
needs:
317342
- build_scancode_for_release_linux
@@ -350,6 +375,9 @@ jobs:
350375
351376
352377
smoke_test_install_and_run_app_archives_on_macos:
378+
permissions:
379+
contents: read # to fetch code (actions/checkout)
380+
353381
name: Test app on ${{ matrix.os }}
354382
needs:
355383
- build_scancode_for_release_macos
@@ -388,6 +416,9 @@ jobs:
388416
389417
390418
smoke_test_install_and_run_app_archives_on_windows:
419+
permissions:
420+
contents: read # to fetch code (actions/checkout)
421+
391422
name: Test app on ${{ matrix.os }}
392423
needs:
393424
- build_scancode_for_release_windows
@@ -422,6 +453,9 @@ jobs:
422453
for %%F in (dist/*.zip) do python etc/release/scancode_release_tests.py dist/%%F
423454
424455
publish_to_gh_release:
456+
permissions:
457+
contents: write # to create GitHub release (softprops/action-gh-release)
458+
425459
name: Publish to GH Release
426460
needs:
427461
- smoke_test_install_and_run_app_archives_on_linux

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ License detection:
5555
as an option.
5656

5757

58+
v31.2.0 - 2022-09-29
59+
----------------------------------
60+
61+
This is a minor release with small bug fixes and minor feature updates.
62+
63+
- Update SPDX license list to 3.18
64+
- Improve how we discard license matches that are "gibberish"
65+
- And new and improve existing license and license detection rules
5866

5967

6068
v31.1.1 - 2022-09-02

ROADMAP.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,27 @@ even if it is correct and it is technically correct.
1818
The goal of this improvement is to:
1919

2020
- combine multiple related license matches in a single license detection
21+
2122
- in a license detection, expose a primary license expression in addition
2223
to the complete, full license expression.
24+
2325
- make the logic of selection of the primary license visible, at the minimum
2426
with a log of combination and primary license selection operations
2527

2628
This is for SCTK first.
2729

30+
Status: This has been completed in SCTK and also included in SCIO. We use
31+
an updated --summary option and a new license clarity score for this.
32+
Some work is still in progress as part of 3.) "detections"
33+
2834

2935
2. Package files.
3036
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3137

3238
Reporting the set of package files for each package instance is important because
33-
it allows for natural grouping of these in one unit.
39+
it allows for natural grouping of these in one unit.
40+
41+
This has been completed in SCTK and also included in SCIO.
3442

3543

3644
3. Go to two-level reporting of detections to provide more effective detections

docs/scripts/sphinx_build_link_check.sh

100644100755
File mode changed.

docs/source/misc/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Can I install ScanCode in a Unicode path?
6868
-----------------------------------------
6969

7070
Yes but but it is best to void this for now. See
71-
https://github.com/nexB/scancode- toolkit/issues/867
71+
https://github.com/nexB/scancode-toolkit/issues/867
7272

7373
There is a bug in virtualenv https://github.com/pypa/virtualenv/issues/457 that
7474
is now fixed but has not been extensively tested for ScanCode.

docs/source/tutorials/how_to_add_a_post_scan_plugin.rst

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,71 @@
33
Add A Post-Scan Plugin
44
======================
55

6+
Scan plugins in ``scancode-toolkit``
7+
------------------------------------
8+
9+
A lot of scancode features are built-in plugins which are present with scancode-toolkit source code
10+
and are usually enabled via the different scancode-toolkit CLI options and are grouped by the types
11+
of plugins.
12+
13+
Here are the major types of plugins:
14+
15+
1. Pre-scan plugins (`scancode_pre_scan` in entry points)
16+
17+
These plugins are run before the main scanning steps and are usually
18+
filtering of input files, or file classification steps, on whose results
19+
the main scan plugins depend on. The base plugin class to be extended is ``PreScanPlugin`` at
20+
`/src/plugincode/pre_scan.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/pre_scan.py>`_.
21+
22+
2. Scan plugins (`scancode_scan` in entry points)
23+
24+
The are the scancode plugins which does the file scanning for useful
25+
information like license, copyrights, packages and others. These are
26+
run on multiprocessing for speed as they are done on a per-file basis,
27+
but there can also be post-processing steps on these which are run afterwards
28+
and have access to all the per-file scan results. The base plugin class to be extended is
29+
``ScanPlugin`` at `/src/plugincode/scan.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/scan.py>`_.
30+
31+
3. Post-scan plugins (`scancode_post_scan` in entry points)
32+
33+
These are mainly data processing, summerizing and reporting plugins which
34+
depend on all the results for the scan plugins. These add new codebase level
35+
or file-level attributes, and even removes/modifies data as required
36+
for consolidation or summarization. The base plugin class to be extended is ``PostScanPlugin``
37+
at `/src/plugincode/post_scan.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/post_scan.py>`_.
38+
39+
4. Output plugins (`scancode_output` in entry points)
40+
41+
Supported output options in scancode-toolkit are all plugins and
42+
these can also be multiple output options selected. These convert, process
43+
and writes the data in the specific file format as the output of the scanning
44+
procedures. The base plugin class to be extended is ``OutputPlugin`` at
45+
`/src/plugincode/output.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/output.py>`_.
46+
47+
5. Output Filter Plugins (`scancode_output_filter` in entry points)
48+
49+
There are also output filter plugins which apply filters to the outputs
50+
and is modified. These filters can be based on whether resources had any
51+
detections, ignorables present in licenses and others.
52+
The base plugin class to be extended is ``OutputFilterPlugin`` at
53+
`/src/plugincode/output_filter.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/output_filter.py>`_.
54+
55+
6. Location Provider Plugins
56+
57+
These plugins provide pre-built binary libraries and utilities and their locations which
58+
are packaged to be used in scancode-toolkit. The base plugin class to be extended is
59+
``LocationProviderPlugin`` at `/src/plugincode/location_provider.py <https://github.com/nexB/plugincode/blob/main/src/plugincode/location_provider.py>`_.
60+
61+
662
Built-In vs. Optional Installation
763
----------------------------------
864

965
Built-In
1066
^^^^^^^^
1167

12-
Some post-scan plugins are installed when ScanCode itself is installed, e.g., the
13-
:ref:`license_policy_plugin`, whose code is located here::
68+
Some post-scan plugins are installed when ScanCode itself is installed, and they are specified at
69+
``[options.entry_points]`` in the `setup.cfg <https://github.com/nexB/scancode-toolkit/blob/develop/setup.cfg>`_ file.
70+
For example, the :ref:`license_policy_plugin` is a built-in plugin, whose code is located here::
1471

1572
https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/plugin_license_policy.py
1673

@@ -23,7 +80,7 @@ Optional
2380
ScanCode is also designed to use post-scan plugins that must be installed separately from the
2481
installation of ScanCode. The code for this sort of plugin is located here::
2582

26-
https://github.com/nexB/scancode-toolkit/tree/develop/plugins/
83+
https://github.com/nexB/scancode-plugins
2784

2885
This wiki page will focus on optional post-scan plugins.
2986

@@ -45,26 +102,25 @@ We'll start by creating three folders:
45102
1. Top-level folder -- ``/scancode-hello/``
46103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47104

48-
- In the ``/scancode-toolkit/plugins/`` directory, add a folder with a relevant name, e.g.,
49-
``scancode-hello``. This folder will hold all of your plugin code.
105+
- In the ``scancode-plugins`` repository, in the ``misc`` directory, add a folder with
106+
a relevant name, e.g., ``scancode-hello``. This folder will hold all of your plugin code.
50107

51108
- Inside the ``/scancode-hello/`` folder you'll need to add a folder named ``src`` and 7 files.
52-
53-
1. ``/src/`` -- This folder will contain your primary Python code and is discussed in more detail
54-
in the following section.
109+
``/src/`` -- This folder will contain your primary Python code and is discussed in more detail
110+
in the following section.
55111

56112
The 7 Files are:
57113

58114
1. ``.gitignore`` -- See, e.g.,
59-
`/plugins/scancode-ignore-binaries/.gitignore <https://github.com/nexB/scancode-toolkit/blob/develop/plugins/scancode-ignore-binaries/.gitignore>`_
115+
`/scancode-ignore-binaries/.gitignore <https://github.com/nexB/scancode-plugins/blob/main/misc/scancode-ignore-binaries/.gitignore>`_
60116

61117
::
62118

63119
/build/
64120
/dist/
65121

66122
2. ``apache-2.0.LICENSE`` -- See, e.g.,
67-
`/plugins/scancode-ignore-binaries/apache-2.0.LICENSE <https://github.com/nexB/scancode-toolkit/blob/develop/plugins/scancode-ignore-binaries/apache-2.0.LICENSE>`_
123+
`/scancode-ignore-binaries/apache-2.0.LICENSE <https://github.com/nexB/scancode-plugins/blob/main/misc/scancode-ignore-binaries/apache-2.0.LICENSE>`_
68124

69125
3. ``MANIFEST.in``
70126

@@ -83,7 +139,7 @@ The 7 Files are:
83139
global-exclude *.py[co] __pycache__ *.*~
84140

85141
4. ``NOTICE`` -- See, e.g.,
86-
`/plugins/scancode-ignore-binaries/NOTICE <https://github.com/nexB/scancode-toolkit/blob/develop/plugins/scancode-ignore-binaries/NOTICE>`__
142+
`/scancode-ignore-binaries/NOTICE <https://github.com/nexB/scancode-plugins/blob/main/misc/scancode-ignore-binaries/NOTICE>`__
87143

88144
5. ``README.md``
89145

@@ -129,7 +185,7 @@ The 7 Files are:
129185
long_description=desc,
130186
author='nexB',
131187
author_email='info@aboutcode.org',
132-
url='https://github.com/nexB/scancode-toolkit/plugins/scancode-categories',
188+
url='https://github.com/nexB/scancode-plugins/blob/main/misc/scancode-hello/',
133189
packages=find_packages('src'),
134190
package_dir={'': 'src'},
135191
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
@@ -201,11 +257,11 @@ Create a ``PostScanPlugin`` class
201257
"""""""""""""""""""""""""""""""""
202258

203259
The ``PostScanPlugin`` class
204-
`PostScanPlugin code <https://github.com/nexB/scancode-toolkit/blob/develop/src/plugincode/post_scan.py>`_)
260+
`PostScanPlugin code <https://github.com/nexB/plugincode/blob/main/src/plugincode/post_scan.py>`_)
205261
inherits from the ``CodebasePlugin`` class (see
206-
`CodebasePlugin code <https://github.com/nexB/scancode-toolkit/blob/794d7acf78480823084def703b5d61ade12efdf2/src/plugincode/__init__.py#L139-L150>`_),
262+
`CodebasePlugin code <https://github.com/nexB/plugincode/blob/main/src/plugincode/__init__.py>`_),
207263
which inherits from the ``BasePlugin`` class (see
208-
`BasePlugin code <https://github.com/nexB/scancode-toolkit/blob/794d7acf78480823084def703b5d61ade12efdf2/src/plugincode/__init__.py#L38-L136>`_).
264+
`BasePlugin code <https://github.com/nexB/plugincode/blob/main/src/plugincode/__init__.py>`_).
209265

210266
::
211267

0 commit comments

Comments
 (0)