Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Yaml] Add lint:yaml command usage#6963
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
3afbfb8 to6e27d51Comparecomponents/yaml.rst Outdated
| ~~~~~~~~~~~~~~~~~ | ||
| The syntax of YAML contents can be validated through the CLI using the | ||
| :class:`Symfony\\Component\\Yaml\Command\\LintCommand` command. |
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.
Perhaps we should mention the console component is required (not required by the YAML one, except in dev) ?
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.
Yeah it was expected.. ^^
Btw, how would you mention it? I thought about acaution
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.
Not sure what is the best way to do it, nor where we can encounter similar cases in the components documentation... Simply adding a little sentence followed by:
composer require symfony/console
?
I quickly searched and found those documentations:
- https://github.com/symfony/symfony-docs/blob/master/console/command_in_controller.rst#showing-colorized-command-output
- https://github.com/symfony/symfony-docs/blob/master/setup/bundles.rst#look-for-deprecations-and-fix-them
- https://github.com/symfony/symfony-docs/blob/master/service_container/lazy_services.rst#installation
- https://github.com/symfony/symfony-docs/blob/master/components/form.rst#csrf-protection
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.
Perfect, applied. Thank you
75b5639 toc4376f1Comparefabpot commentedSep 12, 2016
👍 |
javiereguiluz commentedSep 13, 2016
I'm not that sure about this. Fabien is right that this is a component and you must integrate it into your setup ... but at the same time, providing a command that you cannot use unless you build a Console application looks not very friendly for the developer. Could components provide their own commands, ready to use if you also use the Console component? |
chalasr commentedSep 13, 2016
@javiereguiluz My first thought was the same as yours but indeed, it's tricky. Having a I think providing access to commands in components is already a good thing, people who want to use it just have to copy-paste this snippet. Even if not ideal, that's not a big deal. shall I reopensymfony/symfony/pull/19916 for discussion and deciders opinion? |
fabpot commentedSep 13, 2016
I don't understand the last sentence of@javiereguiluz comments. We do provide the command, and it is ready to use with any console application. The snippet in this PR is just how you can create a standalone script that only validate yaml files. But most of the time, you just need to add this command to your pre-existing console app. |
a636897 to4851a2aCompare
javiereguiluz left a 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.
👍
Thanks@chalasr.
components/yaml.rst Outdated
| $ composer require symfony/console | ||
| Create a script containing a console application: |
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.
Create a script containing a console application: ->Create a console application with lint:yaml as its only command: ?
components/yaml.rst Outdated
| # or contents passed to STDIN | ||
| $ cat path/to/file.yml| php lint.php | ||
| The result will be written on STDOUT, default in TXT format. |
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.
Maybe we could replace this:
The result will be written on STDOUT, default in TXT format.For a JSON output, use the ``format`` option:By this:
The result is written to STDOUT and uses a plain text format by default.Add the ``--format`` option to get the output in JSON format:4851a2a toc4172abComparechalasr commentedOct 4, 2016
@javiereguiluz I applied your suggestions, thank you for them. |
xabbuh commentedNov 28, 2016
Thank you@chalasr. |
…luz)This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes#6963).Discussion----------[Yaml] Add lint:yaml command usageThis documentssymfony/symfony#19139 (merged on 3.2) andclosessymfony/symfony#19916.Commits-------ed4cb40 Remove an unneeded code directive44b4ad0 Use `terminal` instead of `bash` for console code78075c1 Yaml] Add lint:yaml command usage
chalasr commentedNov 28, 2016
Looks like gh failed :). Closing as merged. |
xabbuh commentedNov 28, 2016
@chalasr I didn't merge |
This documentssymfony/symfony#19139 (merged on 3.2) andclosessymfony/symfony#19916.