Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

237: scrutinizer clean up #307

Merged
merged 26 commits into from
Mar 16, 2016
Merged

237: scrutinizer clean up #307

merged 26 commits into from
Mar 16, 2016

Conversation

toolstack
Copy link
Contributor

Additional cleanups based on scrutinizer, part of #237.

@GaryJones
Copy link

I'm not sure which coding standard you're using, but there are rules being updated that include whitespace and some that don't e.g.:

$rules->name_should_not_be('empty');

vs

$rules->status_should_not_be( 'empty' );

Maybe not strictly picked up in Scrutinizer, but now would be the ideal time to fix them up for consistency.

@toolstack
Copy link
Contributor Author

In those cases I was just replacing the variable names, the rest was left as originally done. There's a case to be made to go through the entire codebase and fix up the coding layout.

@GaryJones
Copy link

There's a case to be made to go through the entire codebase and fix up the coding layout.

If this project follows the same principles as WP core, then PRs just for the sake of code formatting is generally frowned upon, hence the case for doing this now when the lines of code are already being touched.

@@ -7,7 +7,7 @@ class GP_CLI_Translation_Set extends WP_CLI_Command {
* @param string $project Project path
* @param string $locale Locale slug
* @param string $set Set slug
* @return GP_Translation_Set|WP_Error Translation set if available, error otherwise.
* @return object Translation set (GP_Translation_Set class) if available, error (WP_Error class) otherwise. Note, PHPDoc doesn't know about WP_Error so we can explicitly define it in the return types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't accept that reason. We don't write code for tools, we're writing code for users and developers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert it, but slightly disagree with the above. Doc blocks serve a dual purpose, make it easy for developers to understand the code and let tools work with the codebase in a consistent manner.

The above change accomplishes both goals where as the original format only accomplished one of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and let tools work with the codebase in a consistent manner.

True, but it's a plugin for WordPress. Maybe there is a way to include WordPress as a library? Another example is WP_Query.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, other people must have run in to this, we should look in to it more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link handy for the scrutinizer issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be these three if I recall correctly

@toolstack toolstack force-pushed the 237-scrutinizer-clean-up branch 2 times, most recently from 81f84e7 to 7b7bdc1 Compare March 4, 2016 15:06
@toolstack toolstack added this to the 1.1 milestone Mar 11, 2016
@ocean90 ocean90 self-assigned this Mar 15, 2016
@ocean90
Copy link
Member

ocean90 commented Mar 15, 2016

Reviewing.

@ocean90 ocean90 merged commit 4f4cf95 into develop Mar 16, 2016
@ocean90 ocean90 deleted the 237-scrutinizer-clean-up branch March 16, 2016 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants