Skip to content

Add checkstyle rule to forbid empty javadoc comments#20881

Merged
tlrx merged 2 commits intoelastic:masterfrom
tlrx:ban-empty-comments
Nov 21, 2016
Merged

Add checkstyle rule to forbid empty javadoc comments#20881
tlrx merged 2 commits intoelastic:masterfrom
tlrx:ban-empty-comments

Conversation

@tlrx
Copy link
Copy Markdown
Member

@tlrx tlrx commented Oct 12, 2016

As suggested by @nik9000 in #20871 (comment), this PR adds a checkstyle check to ensure that Java files do not contain any empty Javadoc comment.

This also fix few remaining empty comments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This slow down the build a bit but not that much on my boxes.

Copy link
Copy Markdown
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth it I think. I wonder if we could get away with configuring the summary check to forbid empty summaries? That might be faster but is slightly different.

@tlrx
Copy link
Copy Markdown
Member Author

tlrx commented Oct 12, 2016

I wonder if we could get away with configuring the summary check to forbid empty summaries?

That's another option too, but it checks the summary/first sentence of a Javadoc comment and fails on comments like:

/**
 * @deprecated blah
 */

or

/**
 * @authors blah
 */

because it does not have a summary line. We have few comments (~20) like this but I suppose I can find a summary for each of those. Analysis time was really similar on my laptop.

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Oct 12, 2016

I think we probably do want to fix those javadocs but if the speed difference isn't killer then it isn't a high priority.

@jpountz
Copy link
Copy Markdown
Contributor

jpountz commented Oct 12, 2016

YES PLEASE!

@tlrx
Copy link
Copy Markdown
Member Author

tlrx commented Oct 13, 2016

I'm in favor of getting this in in the current state. #20909 would allow us to use all the Javadocs modules from Checkstyle but I didn't manage to get them work correctly for now.

@tlrx tlrx force-pushed the ban-empty-comments branch from 1ea752c to f3b1e7d Compare November 15, 2016 15:50
tlrx added 2 commits November 21, 2016 10:20
This commit adds a RegexpMultiline check to checkstyle that yells when an empty Javadoc comment is found in Java files.

Related elastic#20871
@tlrx tlrx force-pushed the ban-empty-comments branch from f3b1e7d to 5ce150f Compare November 21, 2016 09:20
@tlrx tlrx merged commit e7b9e65 into elastic:master Nov 21, 2016
@tlrx tlrx deleted the ban-empty-comments branch November 21, 2016 11:37
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Nov 22, 2016
* master: (42 commits)
  Add support for merging custom meta data in tribe node (elastic#21552)
  [DOCS] Show EC2's auto attribute (elastic#21474)
  Add information about the removal of store throttling to the migration guide.
  Add a recommendation against large documents to the docs. (elastic#21652)
  Add indices options tests to search api REST tests (elastic#21701)
  Fixing indentation in geospatial querying example. (elastic#21682)
  Fix typo in filters aggregation docs (elastic#21690)
  Add BWC layer for Exceptions (elastic#21694)
  Add checkstyle rule to forbid empty javadoc comments (elastic#20881)
  Docs: Added offline install link for discovery-file plugin
  remove pointless catch exception in TransportSearchAction (elastic#21689)
  Rename ClusterState#lookupPrototypeSafe to `lookupPrototype` and remove previous "unsafe" unused variant (elastic#21686)
  Use a buffer to do character to byte conversion in StreamOutput#writeString (elastic#21680)
  Fix integer overflows when dealing with templates. (elastic#21628)
  Fix highlighting on a stored keyword field (elastic#21645)
  Set execute permissions for native plugin programs (elastic#21657)
  adjust visibility of DiscoveryNodes.Delta constructor
  Remove unused DiscoveryNodes.Delta constructor
  Remove unused DiscoveryNode#removeDeadMembers public method
  Remove minNodeVersion and corresponding public `getSmallestVersion` getter method from DiscoveryNodes
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants