Skip to content

new rule: requireHyphenBeforeDescription#52

Merged
qfox merged 2 commits intojscs-dev:masterfrom
hzoo:require-hyphen-before-@param-description
Nov 18, 2014
Merged

new rule: requireHyphenBeforeDescription#52
qfox merged 2 commits intojscs-dev:masterfrom
hzoo:require-hyphen-before-@param-description

Conversation

@hzoo
Copy link
Copy Markdown
Member

@hzoo hzoo commented Nov 18, 2014

#50

This might need some more tests?

I'm assuming most people want the space so its like - description not -description

so it works like if (tag.description.substring(0, 2) !== '- ') {

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.

Not sure about the location for the error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like there are no location for description property ;-( Probably better to left here tag.loc for now.

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.

Doesn't look jscs has any way of testing the position of the error pointer right now? Since all of our tests in jscs and here are checking if error = 0 or 1.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you check location? Something tells me that column should be passed as third parameter and easier to pass here .loc property

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test checking location.

@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 18, 2014

Nice work. ;-D

@hzoo
Copy link
Copy Markdown
Member Author

hzoo commented Nov 18, 2014

Changed the wording for all the tests in rules and also used report instead of throw

@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 18, 2014

Thanks! Merging?

@hzoo
Copy link
Copy Markdown
Member Author

hzoo commented Nov 18, 2014

Yea sounds good. I wonder if jscs could let you check style for stuff like parameter names, and test case strings so it has the same format.

@hzoo
Copy link
Copy Markdown
Member Author

hzoo commented Nov 18, 2014

Oh - I didn't change the readme yet - just remembered..

qfox added a commit that referenced this pull request Nov 18, 2014
…tion

new rule: requireHyphenBeforeDescription
@qfox qfox merged commit 2caffd5 into jscs-dev:master Nov 18, 2014
@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 18, 2014

Nice catch! I'll wait for README changes before publishing new version.

Btw, jscs has deprecated rule validateJSDoc. The rule that moved to this tiny project ;-)

@hzoo
Copy link
Copy Markdown
Member Author

hzoo commented Nov 18, 2014

Oh yeah I just meant whether it made sense to make a new rule to check for the correct naming like describe('should VERB', ... it('VALUE', ... in jscs-jsdoc

@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 18, 2014

@hzoo Oh, probably jscs-jsdoc is not a place for checking these things, it's generally about doc comments. But it's a nice idea at all. I think will be better to make another plugin for that like jscs-tests-spelling or something ;-) It would be great to have autotested formatted tests ;-D

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants