drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

ModuleHandler->loadInclude() call is not being processed #6120

Closed andyg5000 closed 1 month ago

andyg5000 commented 1 month ago

As originally opened in https://github.com/mglaman/phpstan-drupal/issues/741, phpstan is not loading the includes when testing.

We need to update the phpstan config to load the necessary rules from phpstan-drupal.

andyg5000 commented 1 month ago

The pull request is incoming. We'll be left with these issues to resolve after removing the exclusions of the 2 commands.

 ------ -----------------------------------------------------------------
  Line   Commands/core/LanguageCommands.php
 ------ -----------------------------------------------------------------
  61     Call to an undefined method Psr\Log\LoggerInterface::success().
         ✏️  Commands/core/LanguageCommands.php
 ------ -----------------------------------------------------------------

 ------ ------------------------------------------------------------------
  Line   Commands/core/LocaleCommands.php
 ------ ------------------------------------------------------------------
  488    Variable $reader_item in empty() always exists and is not falsy.
         ✏️  Commands/core/LocaleCommands.php
 ------ ------------------------------------------------------------------
weitzman commented 1 month ago

Could you please grant me push access to this PR? I have a couple updates.

weitzman commented 1 month ago

Also, the phpstan test failures suggest that includes are still not processing https://app.circleci.com/pipelines/github/drush-ops/drush/7241/workflows/2074396b-9939-4d95-9c47-57818a1411cb/jobs/43203/tests

andyg5000 commented 1 month ago

Edits by maintainers should be already allowed. I added you both to the project anyway.

@mglaman and I realized that the phpstan run will be cached even if the phpstan.neon is changed because it only watches the scanned files for cache invalidation. If you pull this down and add the --debug flag you'll see that only the 2 problematic calls (listed above) are being flagged.

Let me know what else you need here.

Thanks, Andy

weitzman commented 1 month ago

Thanks. I moved my fixes to a new PR at #6122. Lets discuss there.