jscs-dev / jscs-jsdoc

JsDoc validation rules for jscs
MIT License
99 stars 35 forks source link

New rule: requireReturnDescription #125

Closed weekens closed 9 years ago

qfox commented 9 years ago

Looks good at all ;-) Not sure why you called 2 cases invalid jsdoc. Can you elaborate?

weekens commented 9 years ago

Well, it's totally analogous to require-param-description.js test. We check that JSCS does NOT report invalid JSDoc in valid case. How would you name the test?

weekens commented 9 years ago

@zxqfox, any news on this request?

qfox commented 9 years ago

Sorry for delay, merged! Thanks!

weekens commented 9 years ago

@zxqfox , didn't get, where is typo? And why did you call these 2 cases 'should not report valid jsdoc for function' and 'should not report valid jsdoc for method'? They ARE valid. And the validator should NOT report INVALID JSDoc.

If you'd like to call these 2 cases the way you do, it is inconsistent with https://github.com/jscs-dev/jscs-jsdoc/blob/master/test/lib/rules/validate-jsdoc/require-param-description.js, where the cases are called 'should not report invalid jsdoc for method' and 'should not report invalid jsdoc for function', respectively.

Please, explain your changes!

qfox commented 9 years ago

@weekens Double negation is a dirty thing, In JSCS we trying to avoid them and to put to case titles what they contains. So if there is valid jsdoc I prefer to put there "valid jsdoc". If there are no errors: better to put there "should not report". An so on. ;-)

You should look at https://github.com/jscs-dev/node-jscs/blob/master/lib/rules/require-multiple-var-decl.js — what this rule means? ;-) "Multiple var statements" or "Multiple variables"? ;-)

qfox commented 9 years ago

@weekens About require-param-description — Seems like need to fix that. ;-(

weekens commented 9 years ago

@zxqfox, I see your point. IMHO, if we want to put 'should not report' in front, then 'should not report errors for valid jsdoc for function' seems a better alternative. But anyway, thanks for explanation! Test case names is not really a big deal, pick the ones you're most comfortable with.

qfox commented 9 years ago

@weekens Yeah, nice suggestion. ;-) Thanks again!