FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18868&edit=1

ID: 18868
Updated by: cweiske@php.net
Reported By: cweiske at php dot net
Summary: jslint+rhino: errors/warnings not detected
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Package Version: SVN
PHP Version: 5.3.8
Roadmap Versions:
New Comment:

This can be fixed by removing the "^" from the regex in
$numMatches = preg_match('/Lint at line ...

Previous Comments:
------------------------------------------------------------------------

[2011-09-23 16:04:02] cweiske

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)
------------------------------------------------------------------------

Search Discussions

  • Gsherwood at Sep 26, 2011 at 2:44 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18868&edit=1

    ID: 18868
    Updated by: gsherwood@squiz.net
    Reported By: cweiske at php dot net
    Summary: jslint+rhino: errors/warnings not detected
    -Status: Open
    +Status: Closed
    Type: Bug
    Package: PHP_CodeSniffer
    Package Version: SVN
    PHP Version: 5.3.8
    -Assigned To:
    +Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -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.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-23 16:06:14] cweiske

    This can be fixed by removing the "^" from the regex in
    $numMatches = preg_match('/Lint at line ...
    ------------------------------------------------------------------------

    [2011-09-23 16:04:02] cweiske

    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)
    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 23, '11 at 2:05p
activeSep 26, '11 at 2:44a
posts2
users2
websitepear.php.net

2 users in discussion

Cweiske: 1 post Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase