Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vale does not recognise javadoc comments #51

Closed
FedorRomanov opened this issue Dec 12, 2017 · 2 comments
Closed

Vale does not recognise javadoc comments #51

FedorRomanov opened this issue Dec 12, 2017 · 2 comments

Comments

@FedorRomanov
Copy link

FedorRomanov commented Dec 12, 2017

Together with C-style comments Java also javadoc comments:

The first line contains the begin-comment delimiter ( /**).

Example:

/**
 * Returns an Image object that can then be painted on the screen. 
 *
 * @param  url  an absolute URL giving the base location of the image
 * @param  name the location of the image, relative to the url argument
 * @return      the image at the specified URL
 * @see         Image
 */
 public Image getImage(URL url, String name) {
  // methodimpl.
 }

When parsing javadoc comments as above in java files, Vale complains about repeating star

 47:6   error    '*' is repeated!              vale.Repetition
 83:6   error    '*' is repeated!              vale.Repetition
 86:6   error    '*' is repeated!              vale.Repetition

As javadoc-comments are widely used in java programs these false-positives errors greatly impede Vale result analysis.
I think that core/format.go file needs to be modified. Now it treats java-comments as c-comments(obviously C does not support javadoc):

var CommentsByNormedExt = map[string]map[string]string{
	".c": {
		"inline":     `(//.+)|(/\*.+\*/)`,
		"blockStart": `(/\*.*)`,
		"blockEnd":   `(.*\*/)`,
	},
.....
	`\.(?:java|bsh)$`:                             {".c", "code"},
....
}
@jdkato jdkato added the bug label Dec 12, 2017
@jdkato
Copy link
Member

jdkato commented Dec 12, 2017

Thanks for the report.

I've actually been working on another project that is specifically designed for extracting comments from source code in a more robust and extensible way. So, this issue is definitely on my radar.

@jdkato
Copy link
Member

jdkato commented Mar 1, 2018

This should be fixed now. Although I haven't actually changed the way comments are handled yet -- I just made repetition a little more precise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants