AdguardTeam/HostlistCompiler

Transformation InsertFinalNewLine not supported

StefanoChiodino opened this issue ยท 1 comments

Hi Adguard team ๐Ÿ‘‹ ,

I was trying to use these transforms:

  "transformations": [
    "Compress",
    "Validate",
    "Deduplicate",
    "TrimLines",
    "InsertFinalNewLine"
  ]

But I receive this error:

โ„น Starting the compiler                                                                                                     09:46:11
โ„น ENUM should be equal to one of the allowed values                                                                         09:46:11
(RemoveComments, RemoveModifiers, Compress, Validate, Deduplicate, InvertAllow)

> 1 | {"name":"Stefano Chiodino's uBlock filter list","sources":[{"source":"ublock-filter.txt"}],"transformations":["Compress","Validate","Deduplicate","TrimLines","InsertFinalNewLine"]}
    |                                                                                                                                                               ^^^^^^^^^^^^^^^^^^^^ ๐Ÿ‘ˆ๐Ÿฝ  Unexpected value, should be equal to one of the allowed values

 ERROR  Failed to validate configuration                                                                                    09:46:11

  at compile (node_modules/@adguard/hostlist-compiler/src/index.js:75:15)
  at main (node_modules/@adguard/hostlist-compiler/src/cli.js:48:29)

If I remove that option I also get:

โ„น Starting @adguard/hostlist-compiler v1.0.12                                                                               09:56:39
โ„น Starting the compiler                                                                                                     09:56:39
โ„น ENUM should be equal to one of the allowed values                                                                         09:56:39
(RemoveComments, RemoveModifiers, Compress, Validate, Deduplicate, InvertAllow)

> 1 | {"name":"Stefano Chiodino's uBlock filter list","sources":[{"source":"filter_list.txt"}],"transformations":["Compress","Validate","Deduplicate","TrimLines"]}
    |                                                                                                                                                 ^^^^^^^^^^^ ๐Ÿ‘ˆ๐Ÿฝ  Did you mean Compress here?

 ERROR  Failed to validate configuration                                                                                    09:56:39

  at compile (node_modules/@adguard/hostlist-compiler/src/index.js:75:15)
  at main (node_modules/@adguard/hostlist-compiler/src/cli.js:48:29)

I got those transformations from the readme: https://github.com/AdguardTeam/HostlistCompiler/blob/master/README.md?plain=1#L216

I'm using adguard/hostlist-compiler version 1.0.12.

Cheers

Oh, the problem is that the newer version was not published to npm.

Fixed it now.