-
-
Notifications
You must be signed in to change notification settings - Fork 88
Generic/IncrementDecrementSpacing: add XML documentation #287
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
Generic/IncrementDecrementSpacing: add XML documentation #287
Conversation
b0e3be5 to
39755ea
Compare
jrfnl
left a comment
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.
Hi @rodrigoprimo, thanks for this PR.
I wonder if it would make sense to simplify these docs to just one standard block and one set of code samples dealing with both pre- as well as post-in/decrement ?
Was there a particular reason to split this into two standards ? After all, the rule is the same "no space between the increment/decrement operator and the "variable" it applies to", doesn't really matter whether it's pre or post in/decrement.
I also wonder if the highlighting via the <em> tags could be made more meaningful. Would it make sense to include the operator in the tags ? and the operator + whitespace for the invalid cases ?
src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml
Outdated
Show resolved
Hide resolved
I was more inclined to use a single block, but I was a bit unsure, so I opted to follow what is recommended in the documentation and created one block per error/warning. I pushed a new commit combining the two blocks into one.
In my opinion, it is better to leave just the whitespaces or the "point" between the variable and the operator in the Could you please elaborate on why highlighting the operator would make the On a side note, the guide on how to write sniff documentation mentions that the HTML and Markdown generators use the I tested with the following command: |
jrfnl
left a comment
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.
Thanks for the update. A few more grammar fixes to go and this is ready for merge.
In the HTML version, this "point" is highlighted, and to me, it is clear that it is marking the place where the sniff is checking
Fair point. Let's leave the <em> tags as they are now.
I don't see anything highlighted when I use the Markdown generator. Is this a bug, or should the documentation be updated?
Might well be a bug. I haven't really looked at that class before.
Then again, if generating in pure markdown - how would you highlight something within a code sample ?
The markdown specs don't really allow for that, other than via a mix of Markdown and HTML, so I suspect the documentation should be updated, not the class.
| $obj->prop<em></em>--; | ||
| ]]> | ||
| </code> | ||
| <code title="Invalid: One or more whitespaces between variables and increment/decrement operators."> |
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.
"whitespaces" is not a word.
I think either one of the following could work:
- "One or more whitespace characters between..."
- "Whitespace between..."
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.
Ops, I didn't know that. Thanks!
I pushed a new commit, replacing the three instances where I used "whitespaces".
| ]]> | ||
| </standard> | ||
| <code_comparison> | ||
| <code title="Valid: No whitespaces between variables and increment/decrement operators."> |
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.
| <code title="Valid: No whitespaces between variables and increment/decrement operators."> | |
| <code title="Valid: No whitespace between variables and increment/decrement operators."> |
| <documentation title="Increment Decrement Spacing"> | ||
| <standard> | ||
| <
Description
This PR adds the XML documentation for the Generic.WhiteSpace.IncrementDecrementSpacing sniff.
Suggested changelog entry
Add XML documentation for the Generic.WhiteSpace.IncrementDecrementSpacing sniff.
Related issues/external references
Part of #148
Types of changes
PR checklist