Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am not sure if this issue is with Drupal coding standard for PHP CodeSniffer defined in Coder module or this is PHP CodeSniffer issue. I am reporting it here.
If some code has complex regex defined then phpcs report incorrect indentation even if indentation is correct.
$ phpcs --standard=Drupal /home/vagrant/docroot/web/docroot/sites/all/modules/custom/components/itinerary_pane/itinerary_format_tour.inc
FILE: ...custom/components/itinerary_pane/itinerary_format_tour.inc
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
90 | ERROR | Use XHTML style <br /> tags instead of <br>
92 | ERROR | Use XHTML style <br /> tags instead of <br>
169 | ERROR | Line indented incorrectly; expected 107 spaces, found 4
170 | ERROR | Line indented incorrectly; expected 109 spaces, found 6
--------------------------------------------------------------------------------
See attached screenshot for line 169 and 170 where error is reported.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2898876-incorrect-indentation.patch | 922.43 KB | anoopsingh92 |
phpcs-incorrect-indent.png | 168.71 KB | msankhala |
Issue fork coder-2898876
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anoopsingh92Hello,
I am checking this issue. I will update you soon.
Thanks
Comment #3
anoopsingh92Hello,
I have fixed some codding standards in this patch please review.
Thanks
Comment #4
anoopsingh92Comment #5
klausi@anoopsingh92 Coder itself does not use Drupal's coding standard but the PHPCS core coding standard to be compatible with modified extended sniffs.
It also looks like your patch has nothing to do with the original reported problem?
@msankhala this issue is quite old, if the problem still exists for you on the most recent Coder version please open a new issue. Thanks!