michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

WPCS #236

Open szepeviktor opened 8 years ago

szepeviktor commented 8 years ago

Good afternoon!

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

szepeviktor commented 8 years ago

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

szepeviktor commented 8 years ago

Could I continue with full WPCS?

szepeviktor commented 8 years ago

Could it get into Travis also?

michaeluno commented 8 years ago

@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).

szepeviktor commented 8 years ago

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

michaeluno commented 8 years ago

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

michaeluno commented 8 years ago

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.

szepeviktor commented 8 years ago

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

michaeluno commented 8 years ago

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.