[PEAR-BUG] Req #13813 [Com]: ScopeIndent with "exact" does not work properly

[email protected] ("mrhyde")
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=13813&edit=1

 ID:               13813
 Comment by:       mrhyde
 Reported By:      dczech at gmail dot com
 Summary:          ScopeIndent with "exact" does not work properly
 Status:           Open
 Type:             Feature/Change Request
 Package:          PHP_CodeSniffer
 Operating System: Irrelevant
 Package Version:  1.1.0a1
 PHP Version:      Irrelevant
 New Comment:

When this fix from blacksheepkhan will be pushed in official package? 
I can confirm it is working.


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

[2011-04-07 07:55:19] squiz

<div id="changeset">
<span class="removed">-Status: Assigned</span>
<span class="added">+Status: Open</span>
</div>

------------------------------------------------------------------------

[2008-05-02 16:30:42] blacksheepkhan

Within line 244 when I change it to be
 $column = ($contentLength - $trimmedContentLength);
erasing the last + 1 all works as expected.

But what I havn't seen before is that this sniff also tests within a
multiline array scope. And I think also other multiline scopes. Maybe it
would be better to have a option which allows to ignore defined scopes
which are multiline.

------------------------------------------------------------------------

[2008-04-30 18:42:08] squiz

I'm marking this as a feature because that is exactly how the sniff was
designed and also, as it happens, the reason I don't use that EXACT
option.

I'll add a new option to allow doc comments to be ignored. Then you can
play around with the options to replicate the current functionality or
ignore doc comments.

------------------------------------------------------------------------

[2008-04-30 16:50:03] blacksheepkhan

Description:
------------
When the new ScopeIndentSniff is being extended to switch the "exact"
boolean parameter on then it does not take in account doc indents.

Reason: We want to have all indents fixed to 4 spaces, not more. But
documentation (inline) lines should be ignored because they are checked
elsewhere.

Test script:
---------------
class anything
{
    /**
     * test
     */
    public function xxxx

Expected result:
----------------
No report expected because doc starts with 4 spaces and public also... 

The 1 space difference from within the doc (line * test and */) should
be ignored.

Actual result:
--------------
Switching "exact" on throws error on "* test" and "*/" being 5 chars
indent.

Switching "exact" would not throw an error when indention is more than 4
for public or other lines.

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=13813&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.