aboutcode-org / aboutcode-org/scancode-toolkit

empty files are reported with empty hash in spdx tag/value, that makes it invalid

Aperta
#2,668 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
2.6k
Fork
791
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

### Description

The generated spdx in tag/value format is invalid, if the scan contained an empty file, e.g. the following part is invalid since it misses the SHA1 hash:

```
131 │ # File
132 │
133 │ FileName: ./public/.keep
134 │ FileChecksum: SHA1:
135 │ LicenseConcluded: NOASSERTION
136 │ LicenseInfoInFile: NONE
137 │ FileCopyrightText: NONE
```

### How To Reproduce

* scan a directory with an empty file
* generate tag/value
* use https://tools.spdx.org/app/validate/ to validate and see the following violation:

![Bildschirmfoto_2021-08-25_21-12-38](https://user-images.githubusercontent.com/1187050/130851110-625c25dc-e869-48f3-b67b-41d03a7dfcf0.png)

### System configuration
v21.8.4

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.