Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #18868 jslint+rhino: errors/warnings not detected
Submitted: 2011-09-23 20:04 UTC
From: cweiske Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.3.8 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 - 5 = ?

 
 [2011-09-23 20:04 UTC] cweiske (Christian Weiske)
Description: ------------ Using lib/rhinoed_jslint.js from https://github.com/mikewest/jslint-utils (since jslint has no direct rhino-support anymore) leads to the problem that errors and warnings war not detected. Rhino's exit code is 2 and there is enough output. Test script: --------------- Output (var_dump): array(9) { [0]=> string(108) "[/home/cweiske/bin/jslint-utils/footnotesApi.js] Lint at line 101 character 9: 'strLocation' is not defined." [1]=> string(47) "strLocation = Footnotes.Api.getLocation();" [2]=> string(0) "" [3]=> string(109) "[/home/cweiske/bin/jslint-utils/footnotesApi.js] Lint at line 102 character 49: 'strLocation' is not defined." [4]=> string(64) "$('a[href$=#' + id + ']').attr("href", strLocation + '#' + id);" [5]=> string(0) "" [6]=> string(116) "[/home/cweiske/bin/jslint-utils/footnotesApi.js] Lint at line 105 character 2: Expected ';' and instead saw '(end)'." [7]=> string(1) "}" [8]=> string(0) "" } int(2) Actual result: -------------- > DONE in 6 seconds (0 errors, 0 warnings)

Comments

 [2011-09-23 20:06 UTC] cweiske (Christian Weiske)
This can be fixed by removing the "^" from the regex in > $numMatches = preg_match('/Lint at line ...
 [2011-09-26 08:45 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Thanks a lot. The fix worked great.