-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
deno fmtRelated to the "deno fmt" subcommand or dprintRelated to the "deno fmt" subcommand or dprint
Description
I have a large HTML file. I can format it in 0.2 seconds with deno fmt
. However, when I try to check its formatting with deno fmt --check
, Deno gets stuck at 100 % CPU utilisation for several minutes without showing any output.
It seems to be related to how much the file deviates from Deno's target format. When I run deno fmt
and then insert a few space characters somewhere, then deno fmt --check
returns immediately and prints the correct output.
$ cd /tmp
$
$ # Get a large HTML file, and check it
$ curl -so api.html https://core.telegram.org/bots/api
$ deno fmt --check api.html
^C
$
$ # Proof that a nearly correct file does not cause the issue
$ time deno fmt api.html
/tmp/api.html
Checked 1 file
real 0m0.181s
user 0m0.152s
sys 0m0.028s
$ sed -i '2s/^/ /' api.html
$ time deno fmt --check api.html
from /tmp/api.html:
2 | - <html class="">
2 | +<html class="">
error: Found 1 not formatted file in 1 file
real 0m0.148s
user 0m0.089s
sys 0m0.036s
Version: Deno 2.4.5
Metadata
Metadata
Assignees
Labels
deno fmtRelated to the "deno fmt" subcommand or dprintRelated to the "deno fmt" subcommand or dprint