Comments (7)
So something like
<inspectFiles>
<directory name="src" />
<directory name="tests">
<excludeFiles>
<directory name="tests/Stubs" />
</excludeFiles>
</directory>
</inspectFiles>
from psalm.
Not a bug – you cannot exclude specific directories like that. But I could add support for that within the inspectFiles area. In the meantime you could put the files you do want to tests in a subdirectory of tests
from psalm.
It'd definitely be nice to have this, otherwise I've got to do:
<inspectFiles>
<directory name="src" />
<file name="tests/bootstrap.php" />
<file name="tests/CompilerTest" />
<file name="tests/ParserTest.php" />
<directory name="tests/Parser" />
<directory name="tests/Traits" />
</inspectFiles>
from psalm.
Yeah that might work. Why not support the example in the top of the ticket?
from psalm.
I like keeping the specific files that will be checked in a self-contained node.
Maybe includeFiles
and excludeFiles
could be deprecated in favour of onlyFiles
and ignoreFiles
, as the latter could then be used in both places. Also I think we could change inspectFiles
to projectFiles
while we're at it.
So the XML would look something like
<psalm>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="tests/Stubs" />
</ignoreFiles>
</projectFiles>
<issueHandler>
<InvalidReturnType>
<onlyFiles>
...
</onlyFiles>
</InvalidReturnType>
<MixedInferredReturnType>
<ignoreFiles>
...
</ignoreFiles>
</MixedInferredReturnType>
</issueHandler>
</psalm>
from psalm.
I like the idea of just moving it to projectFiles
declaration.
from psalm.
The wiki not contain updates about that, but actually is not possible to use pattern for exclude files like:
<directory name="*lib*" /> <directory name="/vendor/*" />
from psalm.
Related Issues (20)
- Callable should only allow public methods if used as arg in a non-$this/self context HOT 1
- False positives testing for array emptiness HOT 13
- property assignment bug with union and int ranges HOT 3
- Psalm crash with invalid annotation HOT 3
- Psalm doesn't support Randomizer methods added in PHP 8.3 HOT 1
- key-of<properties-of<>> miss templates support. HOT 3
- Greater > and Less Than < comparisons with non-numeric, non-string, non-resource types should report error HOT 1
- False-positive `PropertyTypeCoercion` for `static` in trait if used in final class HOT 1
- UndefinedMethod not reported when "parent" used in callable HOT 1
- self, parent and static in callable are deprecated since PHP 8.2 and throw a notice HOT 1
- UndefinedClass when aliasing imports HOT 6
- MoreSpecificReturnType and LessSpecificReturnStatement Error HOT 6
- Weird ReservedWord "Parameter cannot be never" when using Laravel collections HOT 3
- False positive #[Override] required for __toString() HOT 7
- False-positive `InvalidTemplateParam` with `@template-covariant T` when a callable parameter accepts `T` HOT 2
- Implement `@template-type` feature of phpstan HOT 1
- Combination of `@psalm-assert-if-true` and `@psalm-assert-if-false` doesn't work as expected HOT 7
- [master] Generic implicit mixed parameter cannot be overriden by explicit mixed in the descendant HOT 1
- False positive with intersection array shape type (used to work with Psalm 5.13) HOT 1
- False-positive `InvalidArgument` when calling methods on a different instance of a generic class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psalm.