Exclude certain file types from "Perform code analysis" on check in.

已回答

I really like the check box on the commit dialog, "Perform code analysis."  

However, I wish I could tell it to ignore certain file types.  For example.  my ant xml files are littered with spurious errors and so whenever I have an ant file included in the commit it makes a lot of noise that I'd rather not have.  

It doesn't seem like there is any way to adjust the scope of the code analysis?  Am I mistaken?

-g

0
Avatar
Permanently deleted user

incremental wrote:
It doesn't seem like there is any way to adjust the scope of the code analysis?  Am I mistaken?

Not for commits or general editing. Only when running inspection reports via Analyze > Inspect Code...

You can suppress all warnings (or for certain inspections) for a file (such as your ant file). But this of course prevents you from getting those warnings and errors highlighted during editing.
To suppress:

  • put your cursor on an error or warning;
  • type Alt+Enter; select the inspection;
  • use the right arrow key to expand the side menu;
  • select the suppress level desired;
0

I know this is an old post, but several similar questions are routed to it. The problem is that the answer here is a non-answer. This is a very reasonable feature request. For example - when your code includes svg files that are not manually coded, because it's XML they get analyzed. You get resources that are not found or other non-issues with those files. Similar to the ant config examples mentioned elsewhere. In those cases you will never care about these specific files or even with the file type entirely, as in SVG files.

The request here was to be able to just exclude some files from analysis - not to deal with specific rules. I can see examples like:

  • Exclude a file type
  • Exclude an entire directory (e.g. “assets”)
  • Exclude an individual file

I support the request as it will save us from a major annoyance. These files often result in huge numbers of errors and warnings that just contaminate the output as well as slow down the analysis (they can be large) 

1

请先登录再写评论。