Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spaces or indentation not detected #31

Closed
ghost opened this issue Feb 6, 2017 · 6 comments
Closed

spaces or indentation not detected #31

ghost opened this issue Feb 6, 2017 · 6 comments
Assignees

Comments

@ghost
Copy link

ghost commented Feb 6, 2017

Using php standard PSR2:
when indented 2 spaces, it will complain and lint correctly;
when indented 6 or more spaces or multiple tabs, it will not complain and ignore

@ikappas ikappas self-assigned this Feb 11, 2017
@ikappas
Copy link
Owner

ikappas commented Feb 11, 2017

@YanweiJiang can you please provide me with a sample php file that has this behaviour?

@ghost
Copy link
Author

ghost commented Feb 12, 2017

header.txt

Can you please change the file extension to php and give it a go? thanks

@ikappas
Copy link
Owner

ikappas commented Feb 13, 2017

@YanweiJiang I can confirm that this is happening and feels like a phpcs bug so I opened a bug here squizlabs/PHP_CodeSniffer#1345

@ghost
Copy link
Author

ghost commented Feb 13, 2017

agree. I tried in Sublime 3, it has the same issue.

@ikappas
Copy link
Owner

ikappas commented Feb 13, 2017

@YanweiJiang According to squizlabs/PHP_CodeSniffer#1345 this is intended behavior so I am closing this issue.

If you wish to apply more strict rules the following ruleset.xml configuration works the way you want:

<rule ref="Generic.WhiteSpace.ScopeIndent">
    <properties>
        <property name="exact" value="true" />
    </properties>
</rule>

See relevant https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties#genericwhitespacescopeindent

@ikappas ikappas closed this as completed Feb 13, 2017
@ghost
Copy link
Author

ghost commented Feb 13, 2017

Cool. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant