dshxbrzgi090608692 2019-02-11 19:30
浏览 246
已采纳

PhpStorm的代码检查器可以从命令行运行吗?

I'm attempting to implement some quality control on a project, and I've removed all warnings for my project according to a specific profile in the PhpStorm code inspector. Now I want to set up an automated check (maybe a git hook or Jenkins job) so that people don't add additional warnings.

Basically, what I need to do is to run PhpStorm's code > inspect functionality from the command line.

It appears that, by default, PhpStorm uses some kind of internal code inspection tool when I run code > inspect code. It has plugins for PHP Code Sniff and others, but I don't really want to use those. For example, PHP Code Sniff finds all kinds of spacing errors and such (it's a linter, after all), but it doesn't detect things like passing the wrong number of arguments to method signatures (i.e. the stuff I really care about).

So, is there any way to run PhpStorm's code inspection external to PhpStorm?

  • 写回答

1条回答 默认 最新

  • dongyuzhu2244 2019-02-11 19:35
    关注

    Hmmm...

    Looks like posting this question may have given me the clarity I needed to search for the correct answer. Looks like there's a way to do this outlined in the PHPStorm documentation:

    https://www.jetbrains.com/help/phpstorm/command-line-code-inspector.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?