8000 Fixing syntax error in PHP, XML and Yaml examples by Nyholm · Pull Request #15250 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

Nyholm
Copy link
Member
@Nyholm Nyholm commented Apr 16, 2021

I used my new and shiny feature to the docs-parser =)

https://github.com/weaverryan/docs-builder/pull/97

@Nyholm Nyholm requested a review from xabbuh as a code owner April 16, 2021 18:26
@carsonbot carsonbot added this to the 4.4 milestone Apr 16, 2021
Copy link
Contributor
@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Amazing

Copy link
Member
@wouterj wouterj left a 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).

Copy link
Member Author
@Nyholm Nyholm left a 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.

Copy link
Member
@javiereguiluz javiereguiluz left a 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!

@Nyholm Nyholm mentioned this pull request Apr 18, 2021
@javiereguiluz javiereguiluz merged commit 8c38a35 into symfony:4.4 Apr 20, 2021
@javiereguiluz
Copy link
Member

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!

@Nyholm Nyholm deleted the 4.4-syntax-errors branch April 20, 2021 15:47
@Nyholm
Copy link
Member Author
Nyholm commented Apr 20, 2021

Wohoo. Thank you for merging

javiereguiluz added a commit that referenced this pull request Apr 21, 2021
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
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.

6 participants
0