deno icon indicating copy to clipboard operation
deno copied to clipboard

deno fmt `<dir>` & `--ignore=<file in that dir>` non-deterministic precedence?

Open cspotcode opened this issue 1 year ago • 0 comments
trafficstars

Version: Deno deno 2.0.0 (stable, release, x86_64-pc-windows-msvc)

I'm not entirely sure what's happening here, but these two deno invocations illustrate the issue.

In the first, I am checking formatting for the scripts, src, and test directories, but excluding one of the files within the test directory. Deno does not exclude the file. (9 files total)

In the second invocation, I tweak the command to specify test directory twice, keeping all other flags the same. This time, deno fmt correctly excludes the excluded file. (8 files total)

Is deno applying include and exclude rules in a non-deterministic order, so sometimes the file is included, and sometimes not? Or is deno using caching that does not include all flags in the key, so I'm occasionally hitting corrupt cache, and occasionally not?

> deno fmt --check scripts src test --ignore=test/fixture/webpack-project/main.js
Error checking: G:\dev\@cspotcode\outdent\test\fixture\webpack-project\main.js
  Unexpected eof at file:///G:/dev/@cspotcode/outdent/test/fixture/webpack-project/main.js:7:1

    /*!************************************!*\
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~
error: Found 1 not formatted file in 9 files
> deno fmt --check test scripts src test --ignore=test/fixture/webpack-project/main.js
Checked 8 files

cspotcode avatar Oct 12 '24 05:10 cspotcode