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

Docs/WordPress.WhiteSpace.OperatorSpacing #1727

Merged
merged 17 commits into from
May 17, 2022
Merged

Docs/WordPress.WhiteSpace.OperatorSpacing #1727

merged 17 commits into from
May 17, 2022

Conversation

ckanitz
Copy link
Contributor

@ckanitz ckanitz commented Jun 20, 2019

Adds documentation for the WordPress.WhiteSpace.OperatorSpacing

Related to #1722

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

@ckanitz Hi Christopher, mostly looking very good.

The docs are just missing the <em> ...</em> tags to highlight good/bad code, but we weren't that clear about that in the initial explanation, so sorry about that!.

Other than that one more point:
It is customary to have a Valid | Invalid code comparison.
The code comparisons you are doing here are Valid | Valid / Invalid | Invalid.

Just thinking out loud: you could possibly combine the two "invalid" examples into one with an inline comment to separate them // Too little space, // Too much space and place that one to go with the first Valid example.

For the second Valid example, the same code sample as for the Valid case can be used with some superfluous whitespace after the && on the second line.

What do you think ?

WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
@ckanitz
Copy link
Contributor Author

ckanitz commented Jul 2, 2019

Just thinking out loud: you could possibly combine the two "invalid" examples into one with an inline comment to separate them // Too little space, // Too much space and place that one to go with the first Valid example.

For the second Valid example, the same code sample as for the Valid case can be used with some superfluous whitespace after the && on the second line.

What do you think ?

Sounds good to me! I applied the changes as suggested.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

@ckanitz Hi Christopher, thank you for making those changes!

Nearly there. I've had a second look and saw some things I missed the first time around. Sorry about that.
Nothing major though, just some small tweaks to finish it off.

I look forward to being able to merge this soon.

WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml Outdated Show resolved Hide resolved
@jrfnl
Copy link
Member

jrfnl commented Oct 7, 2019

@ckanitz Just wondering if you'll have a chance to finish this off in the near future.
I'd like to release WPCS 2.2.0 soon and it would be great if this PR could be included.

If you haven't got time or lost interest, please let us know and we'll see if we can find someone to take over.

ckanitz and others added 17 commits May 16, 2022 15:03
* Be more explicit about which operators are covered by the sniff and what is expected.
* Add a code sample showing that for assignment operators, only the space after the operator is checked (as the space before is determined by alignment).
@jrfnl
Copy link
Member

jrfnl commented May 16, 2022

I've rebased the PR and added one commit to make the last fixes needed. Let's get this merged!

For whomever will merge this: probably squash/merge would be a good idea.

@jrfnl jrfnl added this to the 3.0.0 milestone May 16, 2022
@dingo-d dingo-d requested a review from GaryJones May 16, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants