Bug#1101989: libconfig-model-dpkg-perl: scan-copyrights crashes on eslint
Dominique Dumont
domi.dumont at free.fr
Sat Apr 5 17:07:44 BST 2025
On Thursday, 3 April 2025 18:03:59 Central European Summer Time you wrote:
> While running scan-copyrights on eslint the following error is triggered:
>
> malformed JSON string, neither tag, array, object, number, string or atom,
> at character offset 0 (before "\x{feff}{\n "priv...") at
> /usr/share/perl5/JSON.pm line 190, <$pipe> line 1477.
>
> The issue seems to be triggered by invalid json files
> - tests/fixtures/config-file/broken-package-json/package.json
> - tests/fixtures/ignored-paths/broken-package-json/package.json
Like #1101988, you must configure cme to skip these files. See
https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme#filling-missing-information
https://manpages.debian.org/buster/libconfig-model-dpkg-perl/Dpkg::Copyright::Scanner.3pm.en.html#Filling_the_blanks
> Also file tests/fixtures/config-file/bom/package.json makes he tool to crash
> but due to different reasons.
This file contain non printable characters (eb bb bf) before the first {, so it cannot be parsed by JSON module:
$ hexdump -C tests/fixtures/config-file/bom/package.json
00000000 ef bb bf 7b 0a 20 20 20 20 22 70 72 69 76 61 74 |...{. "privat|
00000010 65 22 3a 20 74 72 75 65 2c 0a 20 20 20 20 22 6e |e": true,. "n|
00000020 61 6d 65 22 3a 20 22 65 73 6c 69 6e 74 2d 74 65 |ame": "eslint-te|
00000030 73 74 22 2c 0a 20 20 20 20 22 76 65 72 73 69 6f |st",. "versio|
00000040 6e 22 3a 20 22 30 2e 30 2e 30 22 2c 0a 20 20 20 |n": "0.0.0",. |
00000050 20 22 65 73 6c 69 6e 74 43 6f 6e 66 69 67 22 3a | "eslintConfig":|
00000060 20 7b 0a 20 20 20 20 20 20 20 20 22 72 75 6c 65 | {. "rule|
00000070 73 22 3a 20 7b 0a 20 20 20 20 20 20 20 20 20 20 |s": {. |
00000080 20 20 22 73 65 6d 69 22 3a 20 22 65 72 72 6f 72 | "semi": "error|
00000090 22 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 |". }. |
000000a0 7d 0a 7d 0a |}.}.|
000000a4
You must add a skip instruction in debian/fill.copyright.blanks.yml to skip this file
All the best
More information about the pkg-perl-maintainers
mailing list