aboutcode-org / aboutcode-org/scancode-toolkit

Incorrect start and end line reported for .sfd file

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

描述

### Description

I noticed that the line numbers were incorrectly reported when performing a scan. I did some digging and it seemed to come down to the file type being `Spline Font Database version 3.0`. I'm not sure if this is the case for all files of this type however.

I also found that these files are [treated specially](https://github.com/nexB/scancode-toolkit/issues/1083) which might related.

### How To Reproduce

A file that you can use to reproduce this bug is:
https://go.googlesource.com/image/+/refs/tags/v0.6.0/font/testdata/CFFTest.sfd

```sh
$ ./scancode --json-pp - --license ./CFFTest.sfd
```

```json
"matches": [
{
"score": 60.5,
"start_line": 4,
"end_line": 4,
"matched_length": 11,
"match_coverage": 61.11,
"matcher": "3-seq",
"license_expression": "bsd-new",
"rule_identifier": "bsd-new_792.RULE",
"rule_relevance": 99,
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_792.RULE"
}
],
```

```sh
$ head ./CFFTest.sfd | cat -n
1 SplineFontDB: 3.0
2 FontName: CFFTest
3 FullName: CFFTest
4 FamilyName: CFFTest
5 Weight: Regular
6 Copyright: Copyright 2016 The Go Authors. All rights reserved.\nUse of this font is governed by a BSD-style license that can be found at https://golang.org/LICENSE.
7 Version: 001.000
8 ItalicAngle: -11.25
9 UnderlinePosition: -100
10 UnderlineWidth: 50
```

### System configuration

* What OS are you running on? Linux
* What version of scancode-toolkit was used to generate the scan file? Current tip of develop 95a5f3303543293aba33bf5b0d88263e042775d4
* What installation method was used to install/run scancode? Source

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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