-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow using pear sniffs with tabs #1362
base: master
Are you sure you want to change the base?
Conversation
c983e41
to
231cea2
Compare
@gsherwood any thoughts on merging this? |
Rebased to fix conflicts |
I've decided to remove this from the 3.2.0 milestone because I'd like to find a better way of allowing any sniff to support tab indents without copy/pasting code and tests. The fact that PHPCS will replace tabs with spaces while checking (assuming you use In addition, auto fixing should be able to apply whitespace indents and have the fixer automatically insert the correct type of indent based on the tab width setting and if the indent was already using tabs or not. Obviously, if you've included a sniff like |
@gsherwood it's been a year since the last comment here - have you had any thoughts about how you'd like to progress with this. I'm willing to implement something else if you have an idea on how to achieve it. Of course your comment is totally on the money. |
I have not had time to look into this and I'm not sure when I will. |
In which case can I persuade you to reconsider this. I know it's not the most optimal thing ever - but it saves us having to create 4 sniffs just to work around this in Joomla (because too many end users got confused 🤷♂️ ) |
I will, when I get time to do some PHPCS dev again. |
In @joomla we want to use these sniffs, but we use tabs instead of spaces. This has left us with a handful of (not so nice options). Copy and keep our own copies of the sniffs with these changes in, changing the message - except the message shows the number of spaces instead of tabs required (even through the autofixer works as expected), so basically this is less about the autofixing and more about displaying a user friendly message.
This is basically the same code taken from the
Generic.Whitespace.ScopeIndentSniff