-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Improve UX ConfigDebugCommand has not yaml component #48457
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
[FrameworkBundle] Improve UX ConfigDebugCommand has not yaml component #48457
Conversation
The command could fallback to json when the Yaml class is not available, the format is very similar (a little more verbose). You can add an option |
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
Indeed it's better to have option like other comment ! I will rework PR to add it |
e28c7a6
to
058f9f0
Compare
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
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.
Much better, thank you for following the suggestion.
The text can be improved, we need some help for that.
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
df13bd9
to
6b47249
Compare
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.
great work @alamirault
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
The <info>--format</info> option specifies the format of the configuration, | ||
this is either <comment>yaml</comment> or <comment>json</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.
The <info>--format</info> option specifies the format of the configuration, | |
this is either <comment>yaml</comment> or <comment>json</comment>. | |
The <info>--format</info> option specifies the output format of the configuration, | |
this is either <comment>yaml</comment> or <comment>json</comment>. | |
When the option is not provided, <comment>yaml</comment> is used when the <comment>symfony/yaml</comment> component is available, | |
otherwise the <comment>json</comment> will be used. |
maybe use the same dynamic getAvailableFormatOptions
approach to generate available format options?
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.
I now use getAvailableFormatOptions
, but don"t know a really adapt sentence.
When the option is not provided, yaml is used when the symfony/yaml component is available,
Not sure if this detail is needed in help
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
01c07b0
to
c7036fa
Compare
c7036fa
to
b20fce5
Compare
Thank you @alamirault. |
I didn't open a documentation issue as I believe those commands are not documented there, but it would be nice if you could double-check 🙏 |
We have some inconsistency here. If you use
Is this desired? Should we probably skip the headline when |
…onfig not possible (Toflar) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | See my comment to the original PR which introduced `debug:config --format=json`: #48457 (comment) Currently, it's not possible to parse the JSON output (neither is the YAML) which makes `--format=json` kind of pointless. The argument against this - I guess - is that the JSON format was introduced to make the command independent from the YAML component but still, why is `--format` an option then? So I guess by delivering an additional option, we can fix this issue and make it parsable. (Maybe instead of having `--no-tilte` we should call it `parsable` in the first place so that if in the future there's something on top of the title, the option would still be valid?) Commits ------- a3e8560 [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible
…onfig not possible (Toflar) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | See my comment to the original PR which introduced `debug:config --format=json`: symfony/symfony#48457 (comment) Currently, it's not possible to parse the JSON output (neither is the YAML) which makes `--format=json` kind of pointless. The argument against this - I guess - is that the JSON format was introduced to make the command independent from the YAML component but still, why is `--format` an option then? So I guess by delivering an additional option, we can fix this issue and make it parsable. (Maybe instead of having `--no-tilte` we should call it `parsable` in the first place so that if in the future there's something on top of the title, the option would still be valid?) Commits ------- a3e8560631 [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible
…onfig not possible (Toflar) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | See my comment to the original PR which introduced `debug:config --format=json`: symfony/symfony#48457 (comment) Currently, it's not possible to parse the JSON output (neither is the YAML) which makes `--format=json` kind of pointless. The argument against this - I guess - is that the JSON format was introduced to make the command independent from the YAML component but still, why is `--format` an option then? So I guess by delivering an additional option, we can fix this issue and make it parsable. (Maybe instead of having `--no-tilte` we should call it `parsable` in the first place so that if in the future there's something on top of the title, the option would still be valid?) Commits ------- a3e8560631 [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible
Throw exception in order to improve UX when Yaml component is missing
Message is inspired by
symfony/src/Symfony/Component/Serializer/Encoder/YamlEncoder.php
Line 56 in 043257f