@@ -83,6 +83,51 @@ detected license, and computed at the codebase resource level, for example:
8383 "[...]" : " [...]"
8484 }
8585
86+ License Clarity Thresholds and Compliance
87+ -----------------------------------------
88+
89+ ScanCode.io also supports **license clarity thresholds **, allowing you to enforce
90+ minimum standards for license detection quality in your codebase. This is managed
91+ through the ``license_clarity_thresholds `` section in your ``policies.yml `` file.
92+
93+ Defining Clarity Thresholds
94+ ---------------------------
95+
96+ Add a ``license_clarity_thresholds `` section to your ``policies.yml `` file, for example:
97+
98+ .. code-block :: yaml
99+
100+ license_clarity_thresholds :
101+ 91 : ok
102+ 80 : warning
103+ 0 : error
104+
105+
106+ License Clarity Compliance in Results
107+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108+
109+ When you run a pipeline with clarity thresholds defined in your ``policies.yml ``,
110+ the computed license clarity compliance alert is included in the project's ``extra_data `` field.
111+
112+ For example:
113+
114+ .. code-block :: json
115+
116+ "extra_data" : {
117+ "md5" : " d23df4a4" ,
118+ "sha1" : " 3e9b61cc98c" ,
119+ "size" : 3095 ,
120+ "sha256" : " abacfc8bcee59067" ,
121+ "sha512" : " 208f6a83c83a4c770b3c0" ,
122+ "filename" : " cuckoo_filter-1.0.6.tar.gz" ,
123+ "sha1_git" : " 3fdb0f82ad59" ,
124+ "license_clarity_compliance_alert" : " error"
125+ }
126+
127+ The ``license_clarity_compliance_alert `` value (e.g., ``"error" ``, ``"warning" ``, or ``"ok" ``)
128+ is computed automatically based on the thresholds you configured and reflects the
129+ overall license clarity status of the scanned codebase.
130+
86131Run the ``check-compliance `` command
87132------------------------------------
88133
@@ -95,7 +140,7 @@ in the project:
95140
96141 .. code-block :: bash
97142
98- 4 compliance issues detected on this project.
143+ 5 compliance issues detected on this project.
99144 [packages]
100145 > ERROR: 3
101146 pkg:pypi/cuckoo-filter@.
@@ -104,6 +149,8 @@ in the project:
104149 [resources]
105150 > ERROR: 1
106151 cuckoo_filter-1.0.6.tar.gz-extract/cuckoo_filter-1.0.6/README.md
152+ [license clarity]
153+ > ERROR
107154
108155 .. tip ::
109156 In case of compliance alerts, the command returns a non-zero exit code which
0 commit comments