aboutcode-org / aboutcode-org/scancode-toolkit

Incorrect start and end line reported for .sfd file

Abierto
#3,294 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
2.6k
Forks
791
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.