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

Adjust a tab level to fix div & PHP open/close #55

Merged
merged 1 commit into from
May 28, 2021

Conversation

jonjennings
Copy link
Contributor

We DO indent inside divs and we DON'T indent inside PHP open/close tags - correct?
In which case the indentation here seems incorrect - removing a level of tab from the div fixes both issues

We DO indent inside divs and we DON'T indent inside PHP open/close tags - correct?
In which case the indentation here seems incorrect - removing a level of tab from the div fixes both issues
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no violation flagged here for WordPress-Core or WordPress-Extra either before or after the change, but I'm fine with moving the markup left.

@GaryJones GaryJones merged commit 128cb48 into WordPress:master May 28, 2021
@jonjennings
Copy link
Contributor Author

Thanks Gary. Yes I'm routinely checking against WordPress-Core and think it's sometimes a little prone to skipping over indentation issues... in fact I specifically noticed this issue here because I was looking for definitive proof that some code that had already been run through PHPCS was indented incorrectly! I know changing the documentation to match your argument is not a classy move...

@jrfnl
Copy link
Member

jrfnl commented May 28, 2021

Just FYI: There are no strict indentation rules for "inline HTML", i.e. code outside of the PHP tags.

The reason for that is that the code author may want the resulting HTML to have a logical indentation in the final HTML source code and as this source code can be build up from code snippets spread out across different files, there is just no way for WPCS to keep track of what the "correct" indentation should be.

Hope that explains it a little.

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

Successfully merging this pull request may close these issues.

3 participants