Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

jsDoc: Bug detecting periods in description #2056

Closed
dharkness opened this issue Jan 7, 2016 · 4 comments
Closed

jsDoc: Bug detecting periods in description #2056

dharkness opened this issue Jan 7, 2016 · 4 comments
Labels

Comments

@dharkness
Copy link
Contributor

This function description is being flagged erroneously. The preceding line does indeed end in a period. Perhaps it's getting tripped up by the HTML?

jsDoc: You started a new line with an upper case letter but previous line does not end with a period at main.js :
539 |     *
540 |     * Any parameter value without a name is assigned the boolean value <code>true</code>.
541 |     * The first such parameter, going from left-to-right, is also assigned to a field named "_".
------------^
542 |     *
543 |     * @private

This happens when separating paragraphs using <p> as well. The suggestion in another issue to strip out HTML would solve it.

/**
 * Does this thing.
 *   <p>
 * Also does something else.
 */
@markelog markelog added the jsdoc label Jan 7, 2016
@markelog
Copy link
Member

markelog commented Jan 7, 2016

/cc @zxqfox

@kepta
Copy link
Contributor

kepta commented Jan 14, 2016

@zxqfox I would love to work on this bug.
Can could guide me on how to take this one?

@qfox
Copy link
Member

qfox commented Jan 14, 2016

@kepta It's a rule requireDescriptionCompleteSentence

https://github.com/jscs-dev/jscs-jsdoc/issues?utf8=✓&q=is%3Aissue+requireDescriptionCompleteSentence

The problem here that this rule based on regular expressions. I know this is not the best thing here but don't see any better solution atm.

Would be great if you'll tackle this. I'm even agree if you'll find some good library for that. I'm really confused atm how this rule should work internally.

@qfox
Copy link
Member

qfox commented Jan 14, 2016

Btw, we have another rules that close to this problem:

Probably we just should move out this rule to separate package with independent release cycle and spec.

qfox pushed a commit to jscs-dev/jscs-jsdoc that referenced this issue Mar 22, 2016
This rule has been flagging comments with html tags.
In this patch the html is sanitized with *** so that it doesn't
interfere with the regular regex tests. The htmlSanitizer function
is padding all strings with 'x.' so that RE_NEW_LINE_START_WITH_UPPER_CASE
doesnt fail. This will need to be improved after discussing with owner if he/she
thinks so.

Fixes jscs-dev/node-jscs#2056
Closes gh-186
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants