admin-page-framework icon indicating copy to clipboard operation
admin-page-framework copied to clipboard

WPCS

Open szepeviktor opened this issue 9 years ago • 9 comments

Good afternoon!

How about fixing indentation and e.g. removing () from include and require?

szepeviktor avatar Feb 17 '16 11:02 szepeviktor

Implemented in https://github.com/michaeluno/admin-page-framework/pull/237

szepeviktor avatar Feb 17 '16 12:02 szepeviktor

Could I continue with full WPCS?

szepeviktor avatar Feb 17 '16 12:02 szepeviktor

Could it get into Travis also?

szepeviktor avatar Feb 17 '16 12:02 szepeviktor

@szepeviktor Hi, thanks for the pull request. I don't mind fixing indentations. I'm not sure about removing the parentheses used for require and include. Is there a merit for doing it?

As for WordPress Coding Standards, I would not be too strict about it. I use 4 white spaces to start an indentation at a new line. I used to use a tab but I have had a hard time posting code on Gist for it as it did not get aligned gracefully. So I changed it to use white spaces. Let me know if you have difficulty using white spaces for indentations.

As for your question about Travis, I could not comprehend your question. Travis is already set up for this repository. Do you want to do something with it? You may check out the Travis configuration file (https://github.com/michaeluno/admin-page-framework/blob/3.7.11/.travis.yml).

michaeluno avatar Feb 17 '16 23:02 michaeluno

As for indentation: You could copy WPCS' directory named WordPress-Core to WordPress-Core-space and comment out this rule: <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/> (or remove this rule in place)

Travis could check whether the commits are WPCS compatible. See .travis.yml and composer.json here https://github.com/pantheon-systems/wp-redis

szepeviktor avatar Feb 18 '16 14:02 szepeviktor

I see you want to implement coding standard checks in the tests. I'll see what I can do.

michaeluno avatar Feb 19 '16 01:02 michaeluno

I added a script in the tool directory to run phpcbf and apply fixes to the files under the development directory.

To run the script, you just execute the run.sh file.

However, by applying fixes, It caused some PHP syntax errors and I had to modify ruleset.xml to remove some of them. There might be some other rules which need to be removed but I haven't completely tested them out. So it would be appreciated if you could run it and see if there is no error after that. Then I can implement the same script in the tests.

michaeluno avatar Feb 24 '16 06:02 michaeluno

OK. Please be aware that composer is supported in Travis by default. https://docs.travis-ci.com/user/languages/php#Installing-Composer-packages

szepeviktor avatar Feb 24 '16 13:02 szepeviktor

Please be aware that composer is supported in Travis by default.

I've been aware of it unless you are talking about something different. I'm not sure why you mention this. If you mentioned it because the use of the phar file in the script, it is for allowing it run locally without requiring the user to install Composer.

michaeluno avatar Feb 25 '16 07:02 michaeluno