berlindb / core

All of the required core code
MIT License
252 stars 27 forks source link

Follow a Coding Standard #149

Open szepeviktor opened 2 years ago

szepeviktor commented 2 years ago
composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
composer exec -- phpcs --standard=WordPress-Core src/ -s --exclude=WordPress.Files.FileName,WordPress.CodeAnalysis.AssignmentInCondition,Squiz.PHP.DisallowMultipleAssignments

These can be automatically fixed by phpcbf.

JJJ commented 1 year ago

Ok, let's give it a try.

I get ornery about WordPress's exact standards, but I know people find value in them, even if I think sometimes they make things worse than my own personal preferences & styles.

szepeviktor commented 1 year ago

but I know people find value in them

Who are those people? They are not industry professional who were raised by eating and drinking source code, but "particularly for those with vision difficulties" (from WPCS docs) and other slight disabilities.

So industry professionals MUST read code that targets people with disabilities. That is very HARD to do.

szepeviktor commented 1 year ago

💡 FYI TAB characters work really well on typewriters.

szepeviktor commented 1 year ago

.. so I've disabled all those things in WPCS and created https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset

szepeviktor commented 1 year ago

@JJJ After running the above commands I've realized that WPCS is not compatible with your Descriptive Programming ©️

Many things get indented the way you don't want.

JJJ commented 1 year ago

Guess I should invent my own style, eh? 😓

szepeviktor commented 1 year ago

YES!!