Git Product home page Git Product logo

Comments (7)

muglug avatar muglug commented on May 26, 2024 1

So something like

<inspectFiles>
    <directory name="src" />
    <directory name="tests">
        <excludeFiles>
            <directory name="tests/Stubs" />
        </excludeFiles>
    </directory>
</inspectFiles>

from psalm.

muglug avatar muglug commented on May 26, 2024

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.

erunion avatar erunion commented on May 26, 2024

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.

erunion avatar erunion commented on May 26, 2024

Yeah that might work. Why not support the example in the top of the ticket?

from psalm.

muglug avatar muglug commented on May 26, 2024

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.

erunion avatar erunion commented on May 26, 2024

I like the idea of just moving it to projectFiles declaration.

from psalm.

Mte90 avatar Mte90 commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.