This meta issue is the parent for all coding-standards and best practice issues for Scheduler 8.x-1.x.

Core 9.5

PHP_codeSniffer 3.7.1, Coder 8.3.15 - 0 messages

Core 10.05

PHP_codeSniffer 3.7.1, Coder 8.3.16 - 0 messages

Correct as at 23 June 2023.

Before posting to this issue please check the current branch test results via https://www.drupal.org/node/3292/qa to confirm that there are coding standards faults that need to be fixed.

To run a coding standards check, the best way is to navigate into the scheduler folder, then just run phpcs

cd path/to/modules/scheduler
phpcs .

or from further up the folder hierarchy you need to specify the --standard parameter

phpcs path/to/modules/scheduler --standard=path/to/modules/scheduler/phpcs.xml.dist

If there is a problem, create a child issue to deal with it, as this is a [meta] issue and should not contain any patches or merge request branches.

Issue fork scheduler-3176822

Command icon 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

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes

At Core 9.2 with new Coder release 8.3.11 we have 11 new coding standards warnings
https://www.drupal.org/pift-ci-job/1921382

  • jonathan1055 committed e8f62b5 on 8.x-1.x
    Issue #3176822 by jonathan1055: Fix @todo coding standard
    
jonathan1055’s picture

Issue summary: View changes

The previous coding standards issue is #2861902: Fix coding standards violations in 8.x codebase

Fixed the 10 @todo coding standards faults.

  • jonathan1055 committed 2975536 on 8.x-1.x
    Issue #3176822 by jonathan1055: Ignore unused variable in...

  • jonathan1055 committed 0a0168b on 2.x
    Issue #3176822 by jonathan1055: Fix coding standards for Coder 8.3.15
    
jonathan1055’s picture

Issue summary: View changes

  • jonathan1055 committed a1c7d35 on 8.x-1.x
    Issue #3176822 by jonathan1055: Fix coding standards for Coder 8.3.15
    

Nisha.Jain made their first commit to this issue’s fork.

Nisha.Jain’s picture

Assigned: Unassigned » Nisha.Jain
Status: Active » Needs work

Hi, I have checked the coding standard issues.I found 3 errors.

user@DESKTOP-OII1FOQ MINGW64 /c/xampp/htdocs/contributionsite/web/modules/contrib
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig scheduler-3176822

FILE: C:\xampp\htdocs\contributionsite\web\modules\contrib\scheduler-3176822\scheduler.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 436 | ERROR | The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\contributionsite\web\modules\contrib\scheduler-3176822\scheduler_rules_integration\scheduler_rules_integration.rules_defaults.inc
-------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------
 28 | ERROR | The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
 43 | ERROR | The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 4.74 secs; Memory: 16MB

Moving status needs to work.

Nisha.Jain’s picture

Assigned: Nisha.Jain » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.42 KB

Hi,
I have created the patch and solved the issues.Please review it.

himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya

Hi @Nisha.jain i am reviewing your patch

himanshu_jhaloya’s picture

StatusFileSize
new78.05 KB
new69.52 KB

Hi @Nisha.jain i reviewed your patch. It is applied cleanly

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
Status: Needs review » Reviewed & tested by the community
jonathan1055’s picture

Status: Reviewed & tested by the community » Active

Hello Nisha.Jain and himanshu_jhaloya,
Thanks for your interest in Scheduler. However there are no coding standards faults that need to be fixed. Take a look at the test output that runs on Drupal.org https://www.drupal.org/pift-ci-job/2457718 - you will see that it is clean.

The problems you see are because you are running a plain phpcs, whereas you should be using the scheduler phpcs.xml file configuration

phpcs --standard=phpcs.xml.dist

There are some customisations for coding standards, such as increasing the allowed array line length and allowing a blank line after a comment. If you run with that option you will see that your messages are not shown.

Actually, you should be able to leave out the --standard option, because Schedulers phpcs.xml.dist file will be used by default if it exists.

Also, please note that when you see an issue with a title that starts with [meta] it means that the issue is created for the purpose of collecting several related issues together and for discussing the bigger picture. There should be no branch forks or patches add to this issue.

Thanks
Jonathan

arti_parmar’s picture

Assigned: Unassigned » arti_parmar
Issue summary: View changes

**

jonathan1055’s picture

@arti_parmar what you have done is very unhelpful. You have erased the existing issue summary and replaced it with 100s of lines of coding standards output which is useless. Please read the comment #15 immediately above yours. You will notice that you are running the wrong command so that the project's phpcs.xml.dist file is not being used. Even if there were coding standards faults (which there aren't) pasting 100s of lines here makes the issue hard to use, you should link to a test output run on drupal.org. In fact if you looked at https://www.drupal.org/node/3292/qa you would see that there are no errors.

ERROR | Missing @category tag in class comment
ERROR | Missing @package tag in class comment
ERROR | Missing @author tag in class comment
ERROR | Missing @license tag in class comment
ERROR | Missing @link tag in class comment
WARNING | Line exceeds 85 characters; 
ERROR | Expected "} else {\n"; found "}\n else {\n"

Messages such as the above imply to me that you are using the wrong set of coding standards sniffs.

arti_parmar’s picture

Assigned: arti_parmar » Unassigned
Issue summary: View changes
jonathan1055’s picture

Title: [meta] Coding Standards in Scheduler 8.x » [meta] Coding Standards in Scheduler 8.x-1.x
Issue summary: View changes

Re-created the issue summary.

Neeraj333’s picture

StatusFileSize
new4.46 KB

I have fixed the error on the scheduler. Please verify this.

jonathan1055’s picture

@Neeraj333 There are no coding standard errors on Scheduler 8.x-1.x. You have wasted your time. Please read the issue summary, and the above comments in #15 and #17.

Neeraj333’s picture

@jonathan1055 Yes but there were some coding standard errors so i fixed them. Thanks.

jonathan1055’s picture

Issue summary: View changes

There are no coding standard errors, you must be running the wrong command, read the comments above.
The branch test show it it clean https://www.drupal.org/pift-ci-job/2505954

rohit.rawat619’s picture

Assigned: Unassigned » rohit.rawat619

Fixing coding Standard

rohit.rawat619’s picture

Assigned: rohit.rawat619 » Unassigned
Status: Active » Needs review
StatusFileSize
new2.14 KB

Status: Needs review » Needs work
jonathan1055’s picture

RohitRawat676, there are no coding standards faults in Scheduler 8.x-1.x
I think you are not running the phpcs script correctly. You need to make sure the projects phpcs.xml config file is being used.
See https://www.drupal.org/project/scheduler#standards

jonathan1055’s picture

Issue summary: View changes
Status: Needs work » Active

Updated issue summary, now that 8.x-1.x also runs on D10

jonathan1055’s picture

Status: Active » Fixed

Everything is fixed, at 8.x-1.x and 2.x so we no longer need this meta issue.
Individual new issues can be raised when coding standards are updated and new warning reported.

Status: Fixed » Closed (fixed)

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