When you run coder against PHPCS standards it returns quite a few errors and warnings. Are we targetting to have coder become PHPCS compliant? Also do we have a phpcs.xml for coder? I see that there is one under squizlabs - ./vendor/squizlabs/php_codesniffer/phpcs.xml.dist

Comments

anoopjohn created an issue. See original summary.

klausi’s picture

Title: Are we targeting to have coder become PHPCS compliant fully? » Make coder more PHPCS compliant?
Category: Support request » Task

Yes, we aim to make Coder as PHPCS compliant as possible. It will probably not be fully compliant, because we don't use @author tags and some other documentation practices. But otherwise feel free to roll a patch to add a phpcs.xml.dist file and fix up some coding standards we are currently missing!

anoopjohn’s picture

Status: Active » Needs review
StatusFileSize
new882 bytes

Please find a patch that adds a phpcs.xml.dist. I have excluded

PEAR.Commenting.FileComment.MissingAuthorTag
PEAR.Commenting.FileComment.MissingLicenseTag
PEAR.Commenting.ClassComment.MissingAuthorTag
PEAR.Commenting.ClassComment.MissingLicenseTag
Generic.Files.LineLength.TooLong

for now. Hope that is good to start.

  • klausi committed 0bc1be0 on 8.x-2.x authored by anoopjohn
    Issue #2734539 by anoopjohn: Added phpcs.xml.dist config file for coding...
klausi’s picture

Status: Needs review » Active

Thanks, committed! I'm going to run phpcbf to automatically fix the trivial stuff now.

klausi’s picture

Title: Make coder more PHPCS compliant? » Make coder more PHPCS compliant

OK, now we can fix stuff manually that is still reported by running phpcs.

anoopjohn’s picture

Great. Do I create child issues with fixes per sub-sniff or by fixes per file?

anoopjohn’s picture

I see that there are not too many errors. I went ahead and created child issues by sniff (or groups of sniffs) and have attached patches.

  • klausi committed 09ebf89 on 8.x-2.x
    Issue #2734539: Make coder more PHPCS compliant: disable certain sniffs...

  • klausi committed a75077b on 8.x-2.x
    Issue #2734539: Make Coder more PHPCS compliant: @return comments
    

  • klausi committed fc861b7 on 8.x-2.x
    Issue #2734539: Make Coder more PHPCS compliant: @param comments
    

  • klausi committed 71b0eae on 8.x-2.x
    docs(VariableAnalysisSniff): Add missing function doc blocks (#2734539)
    

  • klausi committed 44d22e1 on 8.x-2.x
    docs(param comments): Improve coding standards for param comments (#...

  • klausi authored c85aae1 on 8.x-3.x
    style(PHPCS): Apply newest version of PHPCS cosing standards (#2734539)
    
    

  • klausi authored 82ea73d on 8.x-3.x
    style(PHPCS): Apply coding standards to test classes (#2734539)
    
    

  • klausi committed d118f74 on 8.x-3.x
    style(VariableAnalysis): Fix variable names and add doc comments to call...
klausi’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Active » Fixed

I think we are done here, there are some very minor exceptions in phpcs.xml dist that we can fix later if we want to.

Status: Fixed » Closed (fixed)

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