Edit report at https://pear.php.net/bugs/bug.php?id=19246&edit=1

ID: 19246
Updated by: gsherwood@squiz.net
Reported By: barnettech at gmail dot com
Summary: In Eclipse CodeSniffer drops the extensions paramater
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Operating System: Mac
Package Version: 1.3.2
PHP Version: 5.3.1
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
You may want to try running phpcs on the command line to make sure it is
working. I
have tried it and it works correctly for me when I specify an extensions
line argument such as:
phpcs --extensions=php,module ...

I didn't write the eclipse plugin and have never used it, but if the
command line
works fine for you, then it is the eclipse plugin that is broken and not

PHP_CodeSniffer. I don't see any --extensions argument in the debug
output you
provided, so maybe it hasn't been added correctly to the plugin.

Previous Comments:

[2012-01-24 12:27:55] barnettech

I successfully installed code sniffer in Eclipse, but it only works
on .php files. I right clicked on preferences->php tools ->php
CodeSniffer and I set file extensions to be
php,module,inc,install,test,profile,theme and still the code sniffer
only flags files with the php extension.

In the console I see the extensions parameter did not get set,
here is what I see:

/usr/bin/php -c
g/session3952346344543095394.tmp -d asp_tags=off
ffer_1.3.0.R20111119000000/php/tools/phpcs.php --report=xml
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="1.3.2">

So I did some digging. If I insert these lines on lines 424 and
425 of

$the_extensions = 'php,module';
$values['extensions'] = explode(',', $the_extensions);
Then it will start examining files with both php and module as an

I just confirmed that the only thing in variable $arg when public
function processLongArgument($arg, $pos, $values) gets called
dard" (that function is in the CLI.php file mentioned above). So
the extensions parameter is never getting set.

This bug was discussed in drupal forum:

Expected result:
I would have expected to be able to run CodeSniffer on any file
extension that I specify

Actual result:
The actual result is even if you specify valid extensions it only
works with files with extension php.


Edit this bug report at https://pear.php.net/bugs/bug.php?id=19246&edit=1

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedJan 29, '12 at 9:51p
activeJan 29, '12 at 9:51p

1 user in discussion

Gsherwood: 1 post



site design / logo © 2022 Grokbase