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

Content update changes in PHP Coding Standards #65

Merged
merged 8 commits into from
May 21, 2022
Merged

Conversation

dingo-d
Copy link
Member

@dingo-d dingo-d commented Apr 17, 2022

This is the first part of the updates to the WPCS PHP documentation. In this PR I've gone through the text and replaced all the HTML with markdown syntax.

Some links have been updated - some HTTP to HTTPS replacements; data validation now points to the plugins handbook (as a part of the move from codex to developers documentation); added title refs to trac tickets.

I've looked at the JS coding standards documentation and markdown is used there, so don't see why it shouldn't be used here as well.

The second part of the updates will see what rules can be added from the make post in 2020. There are some ongoing discussions that are not resolved, but I'll add only the one that nobody had any issues with within the comments.

@jrfnl and I agreed that we should add this to the handbook so that the WPCS 3.0.0 release can be made in line with the new additions.

But I'll open a separate PR for that 🙂

Fixes: #19

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.

@dingo-d Thank you for doing this! Looks great!

  1. If we're now changing the text to markdown anyway, what about using definition links instead of inline links ? May need verification that the WP Parser handles those correctly though.
    A definition link in markdown is:
    Some text with a [descriptive link].
    
    [descriptive link]: http://link.to/
  2. Some code samples use characters which need escaping in HTML, like > in ->. I seem to remember there were problems with double escaping when parsing those in the past.
    We may need to verify that after this change is merged, they are still displayed correctly, i.e. displayed as -> not -> and if not, may need to selectively revert those changes.

While reading the code diff, I also noticed various other things. I've left inline comments for these and marked them as "not directly related to this PR".

Those comments don't need to be addressed in this PR, but might warrant a follow-up PR.

wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
@dingo-d
Copy link
Member Author

dingo-d commented Apr 18, 2022

Thanks for the review @jrfnl. I'll wait on comments on some of the issues you've mentioned from the rest of the team @GaryJones @ntwb @SergeyBiryukov before making changes.

If we're now changing the text to markdown anyway, what about using definition links instead of inline links?

I kinda like inline links more. They do clutter markdown file a bit, but it's easier to see what the link points to.

Some code samples use characters which need escaping in HTML, like > in ->. I seem to remember there were problems with double escaping when parsing those in the past.

Yes, I remember people having to replace those, I cannot test this so I'm unsure if this will cause breakage. I didn't find any instances of encoded HTML in the JavaScript chapter, so I just presumed as long as they are contained in backticks, we should be good (🤞🏼).

@GaryJones GaryJones changed the title Markdown stlying update Markdown styling update Apr 18, 2022
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

Assuming the renderer can handle standard Markdown, then changes generally look good.

I'd agree with keeping inline links - easier to follow when reading raw markdown than have to skip to the end of the paragraph/section/file to look for a URL, especially when most/all of the links are unique.

wordpress-coding-standards/php.md Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

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

Looking good, I've added a couple of minor nits, I've got a linting configuration setup locally, I created this quite some time ago using Remark-Lint, I started updating it last night to use Markdown Lint as that's what WordPress are now using for MD linting... I'll try to get this pushed up here in the coming days....

wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
@dingo-d dingo-d requested review from ntwb, GaryJones and jrfnl April 22, 2022 13:10
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.

Okay.... so originally this PR was a PR to update the document from using HTML to using markdown.

Unfortunately, it has now evolved to include more extensive changes to the document, including removing sections and rewriting some texts.

For the purpose of having a clean history, I'd personally prefer we'd split this PR into two (or more PRs), with the markup changes in one PR and the textual changes in one or more follow-up PRs.

That would also prevent this PR from lingering as the original change proposal was perfectly fine and only gathered very few comments regarding the actual markup changes.
This PR could have (and should have) been merged already, but the PR is now being delayed/dragged out due to the scope of the PR creeping into different territories.

What about if we split this into the following separate PRs ?

  1. Purely the markup changes from HTML to Markdown.
  2. Textual updates for outdated content (removing references to PEAR, removing the Changelog, updating texts relating to PHP functionality which has since changed etc).
  3. Update the code samples for a) correct capitalization and punctuation of inline comments and b) correct use of output escaping in the code samples (and any other suggestions made).
  4. Whatever remains.

Having said that, as textual changes are now happening anyway (either in this PR or in follow-up PRs), I've gone through the document again with a fine toothcomb (including the parts of the document which were untouched by the original PR) and left a range of remarks to address.
IMO, nearly all these comments should be addressed in follow-up PRs and not so much in this PR.

wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
@jrfnl jrfnl mentioned this pull request May 2, 2022
@ntwb ntwb mentioned this pull request May 2, 2022
@dingo-d
Copy link
Member Author

dingo-d commented May 2, 2022

@GaryJones @ntwb do you agree that I create a separate PR just for markdown changes made (the first few commits), then I can rebase this one and we can handle the changes Juliette suggested here?
That way we don't do much in just one PR.

@GaryJones
Copy link
Member

do you agree that I create a separate PR just for markdown changes made (the first few commits), then I can rebase this one and we can handle the changes Juliette suggested here?

Of course :-)

@dingo-d dingo-d force-pushed the markdown-stlying-update branch from f777d31 to be3efbe Compare May 6, 2022 13:54
@dingo-d dingo-d changed the title Markdown styling update Content update changes in PHP Coding Standards May 6, 2022
Textual update of the PHP coding standards document.

Includes:
* Removing outdated references to PEAR, BackPress and the defunct Hackers mailinglist.
* Updating various texts to be in line with the current state of PHP.
* Removed unnecessary "PHP" H2 subheader.
* Changed the rest of the headers from H3 to H2.
* Removed the credits and changelog as they were wildly inaccurate and out of date.
* Various small textual clarifications and grammar improvements.
@jrfnl jrfnl force-pushed the markdown-stlying-update branch from ebb105b to f51392f Compare May 6, 2022 16:37
@dingo-d dingo-d requested a review from jrfnl May 6, 2022 16:40
@dingo-d
Copy link
Member Author

dingo-d commented May 6, 2022

@GaryJones @ntwb Juliette and I did a pass through and fixed all the content update changes, can you give it another go so that we can merge this?

Thanks!

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.

Looks great! Thanks for getting this sorted @dingo-d ! Looking forward to the next PR with the code sample updates. Great momentum to get it all shiny now.

@dingo-d dingo-d requested a review from GaryJones May 20, 2022 11:08
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.

Crossing our t's and dotting our i's... just two final remarks.

wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
Put the inline documentation above the WPCS mention.
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.

Let's get this merged!

@SergeyBiryukov
Copy link
Member

Thanks for the PR! Left one minor suggestion with a typo fix, looks good to me otherwise 👍

@ntwb ntwb merged commit 4361cec into master May 21, 2022
@ntwb ntwb deleted the markdown-stlying-update branch May 21, 2022 02:03
@dingo-d dingo-d mentioned this pull request Jun 17, 2022
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.

Link to the PHPCS rules
6 participants