How do I make phpcs ignore some files in PHP Storm?

Code Sniffer (as well as Mess Detector) integration is implemented in form of an Inspection which can be configured to be ON or OFF based on scope. Therefore:

  1. Settings | Scopes -- create new custom scope and include all unwanted files/folders

  2. Settings | Inspections | PHP | PHP Code Sniffer validation -- right click on it and choose Add Scope

  3. Now configure this inspection: turn OFF (uncheck) for that scope and leave ON for "Everywhere else" entry.

P.S. PhpStorm v8 has Inspections settings screen a bit redesigned; therefore steps are tiny bit different, but still the same overall (now it's easier for user to discover "scopes" functionality).


This has been tested for PHPStorm 2017.*

  1. Settings/Preferences | Keymap

    find Add to PHPCS ignore list key and add Keyboard Shortcut enter image description here

  2. Go to the file, which one you want to add as ignored and use the shortcut enter image description here

Tags:

Php

Phpstorm