Skip to content

4.0 | Wiki: updates for change of the default standard from PEAR to PSR12 #34

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 15, 2025

Description

Update the docs for change PHPCSStandards/PHP_CodeSniffer#1000

Includes automating various output example blocks via the automated replacement mechanism as introduced in PR #20.

⚠️ This commit should only be merged AFTER the PHPCS 4.0 release! The code samples used for the auto-generated output are specifically crafted to give errors/warnings against PSR12, not against the PEAR standard. ⚠️
Note: this also means that the artifact containing the preprocessed output will need to be regenerated after the PHPCS 4.0 release to get an accurate representation of the updated wiki pages.

Where auto-generated output blocks was not an option, like when the output block in the documentation only displays part of a larger output stream, the command used to manually update the existing output block has been added as an inline comment.

Regarding the "diff" report - even with manually installing DiffUtils in GH Actions, the report does not display, so unless someone figures out why, this will need to be manually updated.

As for the "info" report, while this could be auto-generated using something like {{COMMAND-OUTPUT "phpcs --parallel=1 --no-cache --no-colors --report-width=100 --report=info --basepath=build/wiki-code-samples build/wiki-code-samples/path/to/code/fileB.php build/wiki-code-samples/path/to/code/fileC.php"}}, I believe the existing report example demonstrates the usecase for this report better, so I have deliberately not updated it.

Also not that for the "interactive" reporting code sample, I'm cheating a bit as interactive mode obviously cannot be auto-generated without user interaction, but we do know what the report should look like ;-)

…SR12

Includes automating various output example blocks via the automated replacement mechanism.

:warning: This commit should only be merged AFTER the PHPCS 4.0 release! The code samples used for the auto-generated output are specifically crafted to give errors/warnings against PSR12, not against the PEAR standard. :warning:
Note: this also means that the artifact containing the preprocessed output will need to be regenerated after the PHPCS 4.0 release to get an accurate representation of the updated wiki pages.

Where auto-generated output blocks was not an option, like when the output block in the documentation only displays part of a larger output stream, the command used to manually update the existing output block has been added as an inline comment.

Regarding the "diff" report - even with manually installing DiffUtils in GH Actions, the report does not display, so unless someone figures out why, this will need to be manually updated.

As for the "info" report, while this could be auto-generated using something like `{{COMMAND-OUTPUT "phpcs --parallel=1 --no-cache --no-colors --report-width=100 --report=info --basepath=build/wiki-code-samples build/wiki-code-samples/path/to/code/fileB.php build/wiki-code-samples/path/to/code/fileC.php"}}`, I believe the existing report example demonstrates the usecase for this report better, so I have deliberately not updated it.

Also not that for the "interactive" reporting code sample, I'm cheating a bit as interactive mode obviously cannot be auto-generated without user interaction, but we do know what the report should look like ;-)
Copy link

Thank you for your PR.
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.

Please review the resulting final markdown files via the created artifact.
This is especially important when adding new pages or updating auto-generated output blocks.

N.B.: the above link will automatically be updated when this PR is updated.

@jrfnl
Copy link
Member Author

jrfnl commented Jul 15, 2025

@afilina This is the PR we discussed earlier where most of the "command replacement automation" is being introduced.

@afilina
Copy link
Contributor

afilina commented Jul 16, 2025

Is it too late to call these "command tags" instead of markers or placeholders? I'm thinking mail merge tags, HTML tags and phpBB tags.

@jrfnl
Copy link
Member Author

jrfnl commented Jul 17, 2025

Is it too late to call these "command tags" instead of markers or placeholders? I'm thinking mail merge tags, HTML tags and phpBB tags.

I don't think this PR contains any mention of any of those type of names in the code changes. Or do you mean in the CONTRIBUTING guide ?

@afilina
Copy link
Contributor

afilina commented Jul 17, 2025

I was inattentive and assumed that by introducing automation you meant that this is the PR that has the shell script. That's what I was looking at when I wrote the comment, not the diff of the PR. I opened an independent PR for what I had in mind:
#38

@jrfnl
Copy link
Member Author

jrfnl commented Jul 17, 2025

@afilina Understood.

Depending on which PR is merged first - yours or this one, the other PR needs to be rebased and updated.
(If yours is merged first, the new command replacements being introduced in this PR should be updated to no longer duplicate the default options. If this PR would be merged first, the same should be done, but then in your PR.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants