Running inspections standalone?
Hi,
Is it possible to run the IntelliJ inspections standalone, for example as part of our external build? They can be run from within TeamCity so they must be separated from the IDE to a certain extent, ideally I'd like to integrate them into our build process. Any help appreciated.
Cheers,
Colin
请先登录再写评论。
Hello Colin,
See "Procedures | Inspecting Source Code | Running Inspections Offline" in
the help file.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I can't believe I didn't see that. Thanks Dmitry!
Cheers,
Colin
So I tried this out, I have a couple of questions.
1. Is it possible to select a scope to run the inspections over? Or can the scope of the result file be obtained from the resulting XML?
2. When I run idea offline, it still requires the license key. If I want to be able to run this as part of our build, I need to be able to get this from a standard location for each developer and pass it on the command line. Is this possible?
3. On OSX, at least, the documentation is wrong - the inspections are located in ~/Library/Preferences/IntelliJIDEA70/inspection. Only the ide inspections are available there - is it possible to run project profiles from the command line?
4. IDEA also doesn't pick up my project path variables. Is there a way to specify them?
5. 2) and 4) appear to be because when I run IDEA using idea.sh it's not correctly running using my user profile. Is there a way to specify that it should?
Thanks,
Colin
Hello Colin,
1. you may point directory to be inspected (-d option) or may use -e option
in order to run inspections with editor settings (project profile-scope mapping)
2. as far as I know it is not possible but you may pass -Didea.config.path
(as well as -Didea.system.path) for your build
3. -e option is for you as I mentioned already. It is inconvenient but you
have to pass profile stub as well. Sorry
4. project path variables may be passed as -Dpath.macro.YOUR_VAR_NAME=
5. What about inspect.sh? Sorry I do not understand here ...
Thank you
-
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Hi Anna,
Great, thanks - I'll try -e. BTW is that available in v7? It's not mentioned in the documentation.
What I meant by point 5 was that when I run IDEA using idea.sh (or inspect.sh, which just calls idea.sh directly) it doesn't pick up my user settings - my license, my project roots, etc. So having it automatically run by more than one developer will be difficult. Is there any way around that?
Thanks again,
Colin
Colin,
-e is available since version 6 ;)
For TeamCity we run IDEA with correct system and config folders (passed via -Didea.[system|config].path). Please try to configure shared config/system folders and run IDEA over them.
Thank you
Ok, I'll give that a go - thanks!
Cheers,
Colin