-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
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. |
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. |
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
81f84e7
to
7b7bdc1
Compare
7b7bdc1
to
4ba6ef1
Compare
Reviewing. |
a5d4cbd
to
d0cba01
Compare
f8e793a
to
dd9a8d3
Compare
…e a more descriptive variable name.
…he magic methods.
…he magic methods.
…ins screen. Reduces code duplication.
7417a83
to
31bff5b
Compare
Additional cleanups based on scrutinizer, part of #237.