CodeIgniter Forums
Rulesets for automatic coding style application - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Rulesets for automatic coding style application (/showthread.php?tid=77044)



Rulesets for automatic coding style application - aschmitz - 07-14-2020

Hi everyone,

im pretty new to CI but already started loving the simplicity Smile

As I really like the coding standards implemented and have never before really paid attention to coding style in my projects, I want to adapt the rules for my application too. Currently, I'm using NetBeand 11.3 and I figured that implementing all the rules one by one in the setting is a real pain in the ***.

Therefore, I looked around for existing rulesets for e.g. PHP-CS-FIXER or PHP_CodeSniffer. I found a very old implementation of php_cs in an old CI4 commit here, but this file seems to have been dumped some time between then and now:

https://github.com/codeigniter4/CodeIgniter4/pull/333

Also, I found an old repo by Lonnie which implements the styles for CodeSniffer which was last updated in February:

https://github.com/codeigniter4/coding-standard

So here goes the question:
Is the coding standard implementation in the coding-standard repo usable and reliablie (as it says "work in progress")?

Thanks for any hints!
Alex


RE: Rulesets for automatic coding style application - jreklund - 07-16-2020

Hi, the one that are being used in CodeIgniter 4 are the separate project; https://github.com/codeigniter4/coding-standard
That coding-standard are being run in our pre-commit script; https://github.com/codeigniter4/CodeIgniter4/blob/develop/admin/pre-commit#L32


RE: Rulesets for automatic coding style application - aschmitz - 07-16-2020

Perfect, thank you for the clarification.
I didn't think to look into the scripts ...