Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed

Conversation

@chalasr
Copy link
Member

This documentssymfony/symfony#19139 (merged on 3.2) andclosessymfony/symfony#19916.

mickaelandrieu reacted with thumbs up emoji
~~~~~~~~~~~~~~~~~

The syntax of YAML contents can be validated through the CLI using the
:class:`Symfony\\Component\\Yaml\Command\\LintCommand` command.
Copy link
Contributor

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) ?

Copy link
MemberAuthor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Perfect, applied. Thank you

@chalasrchalasrforce-pushed theyaml/syntax-validation branch 2 times, most recently from75b5639 toc4376f1CompareSeptember 12, 2016 21:51
@fabpot
Copy link
Member

👍

@javiereguiluz
Copy link
Member

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
Copy link
MemberAuthor

@javiereguiluz My first thought was the same as yours but indeed, it's tricky.

Having abin/ directory in a component which doesn't contain asrc/ directory feels wrong imho and, even if it's not blocking, introducing this "mistake" just for alint command sounds slightly overkill.
On the other hand, we just introduced the samebin/ directory in the phpunit-bridge (which is not a component but has the same structure), but as it contains more logic, it seems to make more sense.

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.
I mean: using the components in a standalone way may require some work for reproducing features that are available in the full-stack framework (which has the console as hard dependency and provides a console application).

shall I reopensymfony/symfony/pull/19916 for discussion and deciders opinion?
cc@fabpot

ogizanagi reacted with thumbs up emoji

@fabpot
Copy link
Member

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.

chalasr reacted with thumbs up emoji

@chalasrchalasrforce-pushed theyaml/syntax-validation branch 3 times, most recently froma636897 to4851a2aCompareSeptember 22, 2016 23:09
Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

👍

Thanks@chalasr.

$ composer require symfony/console
Create a script containing a console application:
Copy link
Member

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: ?

chalasr reacted with thumbs up emoji
# or contents passed to STDIN
$ cat path/to/file.yml| php lint.php
The result will be written on STDOUT, default in TXT format.
Copy link
Member

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:

chalasr reacted with thumbs up emoji
@chalasrchalasrforce-pushed theyaml/syntax-validation branch from4851a2a toc4172abCompareOctober 4, 2016 12:37
@chalasr
Copy link
MemberAuthor

@javiereguiluz I applied your suggestions, thank you for them.

@xabbuh
Copy link
Member

Thank you@chalasr.

xabbuh added a commit that referenced this pull requestNov 28, 2016
…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
Copy link
MemberAuthor

Looks like gh failed :). Closing as merged.
Thanks for the improvements@javiereguiluz

@chalasrchalasr deleted the yaml/syntax-validation branchNovember 28, 2016 21:33
@xabbuh
Copy link
Member

@chalasr I didn't merge3.2 intomaster yet. ;)

chalasr reacted with thumbs up emoji

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

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@chalasr@fabpot@javiereguiluz@xabbuh@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp