aboutcode-org / aboutcode-org/scancode-toolkit

python-2.0 license false positive

オープン
#2,377 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug license scan
主要言語
Python
スター
2.6k
フォーク
791
平均マージ
1日 12時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。