-
Notifications
You must be signed in to change notification settings - Fork 860
Consistent Code Indentation/Formatting Across PHP Files #1172
Comments
Kind of in connection to this, is there a reason for the single extra space in front of things like get_header, main-container, and get_footer etc? This could throw tabbing off from the get go. I see this in page.php as well as others. |
@JPOak no reason that I know. Also in relation to this topic, I think it might be helpful to add comments following closing div tags that say what tag is being closed. So <?php
get_header(); ?>
<?php get_template_part( 'template-parts/featured-image' ); ?>
<div class="main-container">
<div class="main-grid">
<main class="main-content">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php comments_template(); ?>
<?php endwhile;?>
</main><!-- main-content end -->
<?php get_sidebar(); ?>
</div><!-- main-grid end -->
</div><!-- main-container end -->
<?php get_footer(); What do you guys think? Putting it on the |
@colin-marshall I vote for the comments. I agree that it is not needed for main. Noticed another single space before the main-content that is not needed on current version. Your version looks tight. I like not having white space as well, except for after the get_header. |
Inspired by the massive changes to WordPress core to fix inconsistencies from the coding standard I went through the FoundationPress code with CodeSniffer and hand-picked some changes. Se the PR above. Don't commit this PR without going through the diffs to make sure only desirable changes are made. I was not sure of everything myself. |
A lot of indentation changes where from this:
…to this:
…and that touched a lot of lines. I think it's the later is correct but I'm not sure everyone agrees. |
@Aetles I prefer the latter and also believe that is correct. |
@derweili I think this can be closed too? |
Looks like a few php files may have inconsistent indentation/formatting.
Examples:
The text was updated successfully, but these errors were encountered: