Control: tags 1100642 confirmed

[ Adding FC ]

Bjarni Ingi Gislason wrote...

> file chk_man.err.import-im7.q16.1
>
>    * What was the outcome of this action?
>
> chk_man.err.import-im7.q16.1: JavaScript source, ASCII text, with very long
> lines (314)
>
>   * What outcome did you expect instead?
>
>   Just ASCII text.

This is caused by a change upstream in commit

<https://github.com/file/file/commit/a2756aa50fdf7d87ebb14002ffd7609373ea6839>
| commit a2756aa50fdf7d87ebb14002ffd7609373ea6839
| Author: Christos Zoulas <chris...@zoulas.com>
| Date:   Thu Jan 12 00:02:16 2023 +0000
|
|     Improve JavaScript detection (FC Stegerman)

@FC as you authored that: The triggering line is

| 0      regex   \^(import|export).*\x20from\x20 JavaScript source

and I was wondering whether there's a way to resolve this. As a first
attempt, checking for an extra space after import, i.e.

| 0      regex   \^(import|export)\x20.*\x20from\x20     JavaScript source

would do the trick. Or using a word boundary:

| 0      regex   \^(import|export)\b.*\x20from\x20       JavaScript source

Perhaps you could improve that, depending what you wwant to achieve and
what caused the initial rules?

    Christoph

Attachment: signature.asc
Description: PGP signature

Reply via email to