test: migrate infer-plugins-ext-dir test cases#34
test: migrate infer-plugins-ext-dir test cases#34fabiospampinato merged 3 commits intoprettier:mainfrom
infer-plugins-ext-dir test cases#34Conversation
| { | ||
| // TODO (43081j): in prettier, this was `*.foo` and would successfully | ||
| // match `src/*.foo`. In prettier CLI, this is not the case | ||
| files: ["**/*.foo"], |
There was a problem hiding this comment.
@fabiospampinato this one seems like something we should discuss/decide before we merge these tests
it seems prettier treats *.foo as if it was **/*.foo, whereas we treat it as ./*.foo
i think we're correct, but this means a whole bunch of prettier configs may fail with our CLI. maybe we should do a special case that transforms "*.ext" into "**/*.ext"?
There was a problem hiding this comment.
Yeah I think so, no need to break the world here. The problem is that this is a bit tricky, what is the actual logic that we want? Worth checking what v3 is actually doing, because there are many potential ways to implement something like this.
I imagine we should try to explode the glob and do something with that in some cases 🤔
I think we can skip this test for now and fix it later if it's the only blocker for this test suite.
Is everything else basically just copy/pasted?
There was a problem hiding this comment.
Pretty much, just the paths changed to the mock/fixture extensions. The rest should be the same
0c953fb to
ada6549
Compare
|
What's the blocker for this PR, interpreting |
|
it should be good to merge and we can track the basically globs with no path are treated like |
|
So in order to select files actually matching |
|
I think treating |
|
@fisker presumably it isn't worth changing this, right? 🤔 how it works currently just seems incorrect to me, if I'm understanding it right. |
34e0257 to
f8dc396
Compare
|
@fisker random question, but if |
|
I don't understand "pick", are we talking about |
|
Basically I think a non relative wildcard would be assumed to mean So internally:
That would be like prettier right now I think |
|
As I said, the Related code in Prettier core https://github.com/prettier/prettier/blob/0d10f1f846351274922cd205f1d4997206183151/src/config/resolve-config.js#L107 The comment in that file can also confirm the fact, though the link is broken now. |
|
If I run the tests just for this I don't see it ever exiting (after a few minutes at least): Does this work for you, @43081j? |
|
mentioned in discord too: its because the worker exits successfully but worktank doesn't propagate this that means we continue waiting for the worker even though it exited long ago under the hood, then inside the CLI, we can decide how to deal with it |
It sounds potentially like a bug on my end, but why is the worker exiting in the first place? 🤔 |
because the plugin doesn't exist (which is what the test is testing I assume? I'll have to re-read them to be sure) either way, its a valid case I think. plugin doesn't exist, so it exits with an error |
|
Is it exiting from inside prettier/standalone or on our end? In my mental model prettier/standalone would never just force-exit 🤔 But I guess we should handle that, I think I missed this edge case in worktank, I'll update it 👍 |
|
it is our exit, not prettier's when you call prettier (via once we have those, we call prettier core. but if the load failed, we exit |
|
Aaaaah yeah, ok I get it now, I'll fix this in |
|
I've just pushed a new version of BUT, on a second thought I think it may be cleaner to just not exit where we are exiting, and instead just throwing a custom error, and then checking against that error and exiting then, from the main thread. |
Pulls the `infer-plugins-ext-dir` tests from prettier.
ca6d971 to
ce99ba5
Compare
Pulls the
infer-plugins-ext-dirtests from prettier.