简体   繁体   中英

How do I get IntelliJ to give me a warning if I have failed to provide JavaDoc description/annotation for public fields and methods?

Eclipse is able to provide warnings if Javadoc has been unfulfilled for a particular method or field. These fields/methods can be grouped by scope (public, protected, etc). I have found this very useful indeed when preparing my software for submission for university or whatever.

Is this not possible in IntelliJ?

Note that I am aware that you can hit "/**" just before a method in IntelliJ and it will fill it out. This isn't exactly what I'm after.

Also note that I'm using IntelliJ 13.01 Community Edition.

For older versions of IntelliJ: Preferences > Inspections > JavaDoc issues > Declaration has JavaDoc problems

For newer versions of IntelliJ: File > Settings... > Editor > Inspections > Java > JavaDoc issues > Declaration has JavaDoc problems

Make sure to move "scope" slider to desired level of visibility for packages, classes, methods, fields and inner classes, by default it is set to "none". You can also set "severity" level.

在此输入图像描述

In addition to continuous monitoring, you can also invoke inspections on demand with Cmd-Option-Shift-I, and enforce inspections prior to VCS commits(although it does not prevent you from committing your code with command line). You can also create specific inspection profiles, one for the university submissions, and another for your side projects, for example.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM