Confused about errors/inspection scopes

I have a package of JAXB generated code. I'm trying to exclude all inspections from that package. Here's what I did:
- created a scope that explicitly excluded that package
- created a project profile (really just a copy of the default)
- set the default project profile to that profile

finally (and this is where I am confused), I added an inspection profile assignment using the scope I created.

But... the generated classes (in package excluded in the scope) still get inspection errors.

Am I missing something. Is there no way to tell Idea "just don't inspect this package/directory ever, for any reason"?

thanks!

-barry

3 comments

Hello Barry,

I have a package of JAXB generated code. I'm trying to exclude all
inspections from that package. Here's what I did:

- created a scope that explicitly excluded that package

- created a project profile (really just a copy of the default)

- set the default project profile to that profile

finally (and this is where I am confused), I added an inspection
profile assignment using the scope I created.


What profile do you assign? In order to exlude from analysis you should assign
"Empty" profile to your scope.

But... the generated classes (in package excluded in the scope) still
get inspection errors.

Am I missing something. Is there no way to tell Idea "just don't
inspect this package/directory ever, for any reason"?

thanks!

-barry


Thank you

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"


0

Ok... Here is my directory/project:

directory/project-root: (abbreviated)
-- production-dir
-- -- jaxb-dir
-- legacy-dir

Here is what I did:

1) define three scopes
- "production-scope" - includes production-dir, excludes production-dir/jaxb-dir
- "generated-scope" - includes only production-dir/jaxb-dir
- "legacy-scope" - includes only legacy-dir

2) defined two profiles:
- "production-profile"
- "empty-profile" (has not inspections enabled)

3) added three profile assignments
- scope="production-scope" profile="production-profile"
- scope="generated-scope" profile="empty-profile"
- scope="legacy-scope" profile="empty-profile"

4) configured the project's default profile to be "empty-profile"

This seems to be working. I created the scopes first and assigned the default project to be "production-profile" thinking that the explicit empty assignment to some scopes would override that. But only after I set the default profile to empty did I get the desired behavior.

So, I'm assuming that I don't even need the "legacy-scope" and "generated-scope". But every time I remove the scopes assignments and restart idea they come back.

Is this the correct way?

thanks!!!

-barry

0

Hello Barry,

Scopes are applied from start to end. I don't quite understand your scopes
hierarchy: does production scope contain all other scopes. If so you need
to assign default profile as default project profile and remove scope="production-scope"
profile="production-profile" assignment. Then everything should work.

Please let me note if smth still goes wrong.

Thank you.

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Ok... Here is my directory/project:

directory/project-root: (abbreviated)

Here is what I did:

1) define three scopes
- "production-scope" - includes production-dir, excludes
production-dir/jaxb-dir
- "generated-scope" - includes only production-dir/jaxb-dir
- "legacy-scope" - includes only legacy-dir
2) defined two profiles:
- "production-profile"
- "empty-profile" (has not inspections enabled)
3) added three profile assignments
- scope="production-scope" profile="production-profile"
- scope="generated-scope" profile="empty-profile"
- scope="legacy-scope" profile="empty-profile"
4) configured the project's default profile to be "empty-profile"

This seems to be working. I created the scopes first and assigned the
default project to be "production-profile" thinking that the explicit
empty assignment to some scopes would override that. But only after I
set the default profile to empty did I get the desired behavior.

So, I'm assuming that I don't even need the "legacy-scope" and
"generated-scope". But every time I remove the scopes assignments and
restart idea they come back.

Is this the correct way?

thanks!!!

-barry



0

Please sign in to leave a comment.