Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: option to exclude directories from analysis. #156

Closed
imonroe opened this issue Apr 9, 2020 · 3 comments
Closed

feature request: option to exclude directories from analysis. #156

imonroe opened this issue Apr 9, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@imonroe
Copy link
Contributor

imonroe commented Apr 9, 2020

We have Codeception acceptance tests in a D8 profile, and when we try to use the drupal-check tool to run analysis on the profile, we're finding it is throwing errors like:

------ ---------------------------------------------------------------- 
  Line   profile/tests/codeception/acceptance/HomePageCest.php  
 ------ ---------------------------------------------------------------- 
         Class HomePageCest was not found while trying to analyse it -   
         autoloading is probably not configured properly.                
 ------ ---------------------------------------------------------------- 

It'd be super if we could exclude those directories via the command invocation:
drupal-check docroot/profiles/custom --exclude-dir=*/tests/codeception

Likely, it'd just be a matter of looking for the option and adding the directory pattern to here:

'excludes_analyse' => [

If that's something you'd be open to, I can probably make a PR fairly quickly.

@klausi
Copy link

klausi commented Apr 24, 2020

Do we have to reinvent everything that PHPStan does? PHPStan has a convenient way to ignore errors: https://phpstan.org/user-guide/ignoring-errors

Can we run drupal-check somehow in PHPStan mode with all of its behavior except that the drupal-checks are also executed?

@klausi
Copy link

klausi commented Apr 24, 2020

Ah cool, this should be possible with https://github.com/mglaman/phpstan-drupal ! Will try that next.

mglaman added a commit that referenced this issue May 10, 2020
#156: Added an exclude option to prevent analysis in selected directories.
@mglaman
Copy link
Owner

mglaman commented May 10, 2020

@klausi want to open an issue around that topic? Basically drupal-check is a simple runner for folks who don't want to configure PHPStan.

@mglaman mglaman closed this as completed May 10, 2020
@mglaman mglaman added the enhancement New feature or request label May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants