Problem/Motivation

  • We have several files within our theme codebase that needs to adhere to a set of coding standards defined by the community.
  • We need to adjust the way we style and format our Twig files to include appropriate indentation, whitespace, commenting, line length, etc. Ensuring that all code adheres to the same style gives the Olivero project a sense of coherence and makes it easier for all of us to read each other's code.

phpcs result on twig files

vendor/bin/phpcs --standard=Drupal --extensions=twig themes/olivero/templates/

FILE: /var/www/html/D-9.1.x-git/themes/olivero/templates/block/block--secondary-menu.html.twig
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 56 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /var/www/html/D-9.1.x-git/themes/olivero/templates/block/block--primary-menu--search-form-block.html.twig
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
 48 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

Time: 80ms; Memory: 8MB

Remaining tasks

CommentFileSizeAuthor
#5 3156210-5.patch801 bytesnitesh624
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ju.vanderw created an issue. See original summary.

nitesh624’s picture

Assigned: Unassigned » nitesh624
nitesh624’s picture

Issue summary: View changes

Updating the issue summary

nitesh624’s picture

Issue summary: View changes
nitesh624’s picture

FileSize
801 bytes
nitesh624’s picture

Assigned: nitesh624 » Unassigned
Status: Active » Needs review
himanshu_sindhwani’s picture

This issue is not reproducible on the latest HEAD.

steinmb’s picture

Version: 8.x-1.0-alpha3 » 8.x-1.x-dev
Status: Needs review » Needs work

Thank you for working on coding standards @nitesh624. Updating issue to latest dev. Did something go into repo. between patch and test? Care to run code sniffer one more time?

nitesh624’s picture

Assigned: Unassigned » nitesh624
nitesh624’s picture

Stilll i can see the coding standard error please see below.

nitesh.kumar@pg01g1ud:/var/www/html/D-9.1.x-git/themes/olivero$ git branch
* (HEAD detached at cac4263)
  8.x-1.x
nitesh.kumar@pg01g1ud:/var/www/html/D-9.1.x-git/themes/olivero$ ../../vendor/bin/phpcs --standard=Drupal --extensions=twig ./templates/

FILE: /var/www/html/D-9.1.x-git/themes/olivero/templates/block/block--secondary-menu.html.twig
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 56 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /var/www/html/D-9.1.x-git/themes/olivero/templates/block/block--primary-menu--search-form-block.html.twig
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
 48 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

Time: 78ms; Memory: 8MB

nitesh.kumar@pg01g1ud:/var/www/html/D-9.1.x-git/themes/olivero$ 

nitesh624’s picture

Assigned: nitesh624 » Unassigned
Status: Needs work » Needs review
steinmb’s picture

Status: Needs review » Reviewed & tested by the community

  • mherchel committed 7c571c4 on 8.x-1.x authored by nitesh624
    Issue #3156210 by nitesh624, steinmb, ju.vanderw: Coding standards...
mherchel’s picture

Status: Reviewed & tested by the community » Fixed

Committing. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.