Exclude Directory from inspection

Can i mark a directory which includes "skeleton files" from the inspection?

The skeleton directory includes several files and directories, which aren't valid php files, they're only templates

class  {{ classname }} extends BaseController


Because of the invalid code, the files and the parent directories are underwaved. Because ALL parent directories are underwaved, it's really hard to see in the project window, if there's really a invalid code, or if it's only because of the skeleton files.

Comment actions Permalink

There is no such thing in PhpStorm as exclude some folder from indexing/inspections only. You can disable all inspections for custom scope (like it is described here: http://devnet.jetbrains.net/message/5465511 ), but it's quite inconvenient to do and I do not think that it will do 100% as you would like.

Few options:

  • Exclude such folder from project from being indexed (Settings | Directories)
  • Mark individual files as plan text (right click in Project View | Mark as Plain text)
  • Disable all inspections for individual file (click on Inspector guy in status bar and see there)
  • Give those files separate extension (e.g. filename.php.tpl) .. and then assign that pattern (e.g. *.php.tpl) to Text file type in Settings | File Types

The last one is the best in my opinion -- if I would do anything like that I would definitely go this way (if I can, of course).

Comment actions Permalink

thx very much

I've excluded the directory, but then i would need to switch the directory status ( include,exclude) all the time when i would need to create a new skeleton file or edit a existing one, that's why I agree, that the last option would be probably the best.

Comment actions Permalink

I need this options myself. We have a large collection fo legacy classes that are still needed in production but can not be updated to psr12 without extreme cascading changes.

We only want to get inspections for the new implementation that is slowly replacing all the legacy files.

Adding all the files one by one to ignore is not viable and can not be excluded from indexing.


Please sign in to leave a comment.