Add option to _ignore_ a project root based on file existence #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new config option,
root_ignore_files
, a table of files whose presence mean a project should not be considered a phpunit project. My main goal here is to preventneotest-phpunit
from claiming projects setup for Pest.You may already be familiar, but just in case: Pest uses PHPUnit under the hood. As such,
phpunit.xml
exists. However, its tests are not compatible with PHPUnit's - so runningphpunit
directly in a Pest project will just crash.Essentially, I've forked
neotest-pest
, updated it for the latest version of pest, and started using it. It's just that sometimes when I hit myrun()
key,neotest-phpunit
seems to "speak up" first and decides my tests are failing (due to the aforementioned crash). I wind up needing to manually selectneotest-pest
in the summary window or some other janky workaround. 😅However, since Pest's setup adds a file
tests/Pest.php
, that's where this newroot_ignore_files
option comes in. It can be set toroot_ignore_files = { "tests/Pest.php" }
andneotest-phpunit
simply ignores the project.