aboutcode-org / aboutcode-org/scancode-toolkit

python-2.0 license false positive

未關閉
#2,377 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug license scan
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

### Description
When trying to scan the project https://github.com/keras-team/keras with latest scancode, It get two false positives.
Two files are:
https://github.com/keras-team/keras/blob/master/keras/distribute/sidecar_evaluator.py
and
https://github.com/keras-team/keras/blob/master/keras/utils/generic_utils.py

"License" and "python" are there in consecutive lines, it is detected as python-2.0 license
```
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Python module for evaluation loop."""

from __future__ import absolute_import
```

```
{
"key": "python",
"score": 100.0,
"name": "Python Software Foundation License v2",
"short_name": "Python License 2.0",
"category": "Permissive",
"is_exception": false,
"owner": "Python Software Foundation (PSF)",
"homepage_url": "http://docs.python.org/license.html",
"text_url": "http://spdx.org/licenses/Python-2.0",
"reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:python",
"spdx_license_key": "Python-2.0",
"spdx_url": "https://spdx.org/licenses/Python-2.0",
"start_line": 13,
"end_line": 15,
"matched_rule": {
"identifier": "python_13.RULE",
"license_expression": "python",
"licenses": [
"python"
],
"is_license_text": false,
"is_license_notice": false,
"is_license_reference": false,
"is_license_tag": true,
"matcher": "2-aho",
"rule_length": 2,
"matched_length": 2,
"match_coverage": 100.0,
"rule_relevance": 100.0
},
"matched_text": "# limitations under the License.\n# ==============================================================================\n\"\"\"Python utilities required by Keras.\"\"\""
}
```
and
```
{
"key": "python",
"score": 100.0,
"name": "Python Software Foundation License v2",
"short_name": "Python License 2.0",
"category": "Permissive",
"is_exception": false,
"owner": "Python Software Foundation (PSF)",
"homepage_url": "http://docs.python.org/license.html",
"text_url": "http://spdx.org/licenses/Python-2.0",
"reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:python",
"spdx_license_key": "Python-2.0",
"spdx_url": "https://spdx.org/licenses/Python-2.0",
"start_line": 14,
"end_line": 16,
"matched_rule": {
"identifier": "python_13.RULE",
"license_expression": "python",
"licenses": [
"python"
],
"is_license_text": false,
"is_license_notice": false,
"is_license_reference": false,
"is_license_tag": true,
"matcher": "2-aho",
"rule_length": 2,
"matched_length": 2,
"match_coverage": 100.0,
"rule_relevance": 100.0
},
"matched_text": "# limitations under the License.\n# ==============================================================================\n\"\"\"Python module for evaluation loop.\"\"\""
}
```
Text for [python_13.RULE](https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/rules/python_13.RULE) is ``` license = "Python"```
### How To Reproduce

scancode -li --license-text --json-pp - generic_utils.py
scancode -li --license-text --json-pp - sidecar_evaluator.py

### System configuration

* What OS are you running on? (Windows/MacOS/Linux)
Ubuntu18.04
* What version of scancode-toolkit was used to generate the scan file?
ScanCode 3.2.3
* What installation method was used to install/run scancode? (pip/source download/other)
pip
* Python version
Python 3.6.12

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。