-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fixing syntax error in PHP, XML and Yaml examples #15250
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
Conversation
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.
Amazing
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.
Whoa, this is a huge work! Thanks for starting this Tobias.
I've left a couple comments on places where I'm not sure if we improved the code example. I think conveying the correct meaning is more important for doc examples than being 100% syntax correct (in any case, I'm +1000 for the cases where you "completed" the example by e.g. adding the class definition).
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.
Thank you.
There are maybe 10-20 more syntax errors and may PHP examples that fails because of other various reasons.
I'll update the PR with your suggestions.
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.
This new linter caught some interesting bugs. Well done!
57d1b05
to
baf9154
Compare
This has been merged in 4.4, 5.2 and 5.x, so we're ready to fix more errors in upper branches. Thanks Tobias! |
Wohoo. Thank you for merging |
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Verify code blocks This PR is a first step to make sure we are using valid code blocks. I created a [small parser](https://github.com/symfony-docs-tools/code-block-checker) that will replace [the PR to the docs builder](https://github.com/weaverryan/docs-builder/pull/97). This CI job will look at the modified files, and give the the the [code-block-checker](https://github.com/symfony-docs-tools/code-block-checker). That project will find the code blocks and make sure they are using valid syntax. It also supports a baseline so we can write invalid syntax if we want to. (it may sometimes make the examples more readable See #15250) ~~The next step is to make sure one can actually run code examples. Im planning to get all examples that starts with a comment and figure out if that is a filepath to the config directory. I will then capture any symfony errors when using that config.~~ This is super helpful when updating the PHP config to use the config builders. EDIT: I included "the next step" in this PR. We do run all config examples. Note that thanks to the baseline feature, will only report **new** errors on modified code blocks. Commits ------- c92641d Verify code blocks
I used my new and shiny feature to the docs-parser =)
https://github.com/weaverryan/docs-builder/pull/97