Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 921
BigTobster Avatar asked Jan 09 '14 01:01

BigTobster


People also ask

How do I get Javadoc in IntelliJ?

From the main menu, select Tools | Generate JavaDoc. In the dialog that opens, select a scope — a set of files or directories for which you want to generate the reference, and set the output directory where the generated documentation will be placed.

How do I check my annotations in IntelliJ?

Enable annotationsRight-click the gutter in the editor or in the Differences Viewer and select Annotate with Git Blame from the context menu. You can assign a custom shortcut to the Annotate command: go to the Keymap page of the IDE settings Ctrl+Alt+S and look for Version Control Systems | Git | Annotate.


1 Answers

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.

enter image description here

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.

enter image description here

like image 76
kukido Avatar answered Oct 12 '22 11:10

kukido