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

[FrameworkBundle][Yaml] Move YamlLintCommand to the Yaml component#19139

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

Merged

Conversation

@chalasr
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18987
LicenseMIT
Doc PR~

See#18987 for the use case.
Also I see several things that can be simplified/optimized in the original command, but I think it would be better to propose the changes in a next PR and just propose the exact changes needed to move it outside of the framework. If all should be done here, let me know before reviewing it.

soullivaneuh reacted with thumbs up emoji
@chalasrchalasr changed the titleMove YamlLintCommand to the Yaml component[Yaml] Move YamlLintCommand to the Yaml componentJun 22, 2016
@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch from4eb636b to5317d77CompareJune 22, 2016 11:39
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class YamlLintCommandextendsCommand
finalclass YamlLintCommandextendsBaseLintCommand
Copy link
Member

Choose a reason for hiding this comment

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

final should be removed here as this is a BC break.

chalasr reacted with thumbs up emoji
@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch 2 times, most recently from3e11039 toaa8f5f2CompareJune 22, 2016 12:22
{
$command = new YamlLintCommand();
$application = new Application();
$application->add($command);
Copy link
Contributor

Choose a reason for hiding this comment

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

$command becomes (hopefully) itself line 34. How about$application->add(new YamlLintCommand()) ? Wouldn't that be less confusing ?

@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch 2 times, most recently frome32eed2 tod908732CompareJune 22, 2016 12:55
protected function configure()
{
$this
->setHelp($this->getFileRelatedHelp().$this->getStdinRelatedHelp())
Copy link
Member

@GromNaNGromNaNJun 22, 2016
edited
Loading

Choose a reason for hiding this comment

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

The stdin part could be moved to the top of the help text to avoid this hackish split.

chalasr reacted with thumbs up emoji
Copy link
Member

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.

Done. BTW this should be used on the Twig LintCommand.

@chalasr
Copy link
MemberAuthor

Of course, the FrameworkBundle test fails because theYaml\Command\LintCommand cannot be found in the Yaml component. Should I remove the test or is there something to do?

@greg0ire
Copy link
Contributor

Of course, the FrameworkBundle test fails because the Yaml\Command\LintCommand cannot be found in the Yaml component. Should I remove the test or is there something to do?

What about adding it torequire-dev ?

@chalasr
Copy link
MemberAuthor

chalasr commentedJun 22, 2016
edited
Loading

Not sure to understand. The Yaml component is already required by the FrameworkBundle. The problem is that the command that it is looking for is provided by this PR.

(Sorry for closing, mistake)

@chalasrchalasr reopened thisJun 22, 2016
@greg0ire
Copy link
Contributor

Not sure to understand. The Yaml component is already required by the FrameworkBundle. The problem is that the command that it is looking for is provided by this PR.

Oh again, I read too fast, nevermind my comment.

@greg0ire
Copy link
Contributor

YamlLintCommans =>YamlLintCommand in your last commit subject (just in case the commit message somehow survives a squash)

@greg0ire
Copy link
Contributor

Of course, the FrameworkBundle test fails because the Yaml\Command\LintCommand cannot be found in the Yaml component. Should I remove the test or is there something to do?

Link for the lazy :https://travis-ci.org/symfony/symfony/jobs/139483789#L2371

@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch fromd908732 to4fabb70CompareJune 22, 2016 14:06
@chalasr
Copy link
MemberAuthor

chalasr commentedJun 22, 2016
edited
Loading

For now I removed the FrameworkBundleYamlLintCommandTest and kept the YamlLintCommandTest, if someone knows a trick for that, please let me know.

@stof
Copy link
Member

@chalasr what is needed is to update the requirement of the component, to force FrameworkBundle to use symfony/yaml 3.2+ (older versions will not have the command, even after merging)

{
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
\RecursiveIteratorIterator::SELF_FIRST
Copy link
Member

Choose a reason for hiding this comment

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

you should actually useLEAVES_ONLY instead ofSELF_FIRST. You don't need directories in the flattened iterator, only files

continue;
}

$files[] = $file;
Copy link
Member

Choose a reason for hiding this comment

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

rather than building an array with all files here, we could yield files to iterate over the filesystem little by little

@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch 4 times, most recently fromadeacad tof5069f3CompareJune 22, 2016 18:57
@chalasrchalasr changed the title[Yaml] Move YamlLintCommand to the Yaml component[FramworkBundle][Yaml] Move YamlLintCommand to the Yaml componentJun 22, 2016
@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch 2 times, most recently frome24bb86 to5789695CompareJune 22, 2016 19:35
@chalasr
Copy link
MemberAuthor

@stof I applied your suggestions, thank you.

Now tests pass.

fabpot added a commit that referenced this pull requestJun 23, 2016
…asr)This PR was merged into the 2.7 branch.Discussion----------[TwigBridge] Fix inconsistency in LintCommand help| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19139 (comment)| License       | MIT| Doc PR        | ~Actually, the `lint:yaml` command's help looks like this:![](http://image.prntscr.com/image/95dddf38ebcf408b8e2e23cf09c3ddf6.png)The last `Or` about STDIN is syntactically wrong, and is the only one to have a code example with indentation. This gives the same indentation for all code blocks and move the STDIN-related part as first, as proposed in#19139 (comment) .Now it looks like:![](http://image.prntscr.com/image/8877349f6be746c981c2e9037d2d17ff.png)Commits-------f54bb16 [TwigBridge] Fix inconsistency in LintCommand help
}

if (!$this->isReadable($filename)) {
throw new \RuntimeException(sprintf('File or directory "%s" is not readable', $filename));
Copy link
Member

Choose a reason for hiding this comment

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

missing dot at the end of the message

@javiereguiluzjaviereguiluz changed the title[FramworkBundle][Yaml] Move YamlLintCommand to the Yaml component[FrameworkBundle][Yaml] Move YamlLintCommand to the Yaml componentJun 23, 2016
@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch 3 times, most recently from36d7732 to5129dbeCompareJune 23, 2016 10:59
Add testsFix tests & YamlLintCommand help formattingfabbot fixesUse Generator to iterate over the filesystemMove STDIN related code in a methodUse RecursiveIteratorIterator::LEAVES_ONLY rather than SELF_FIRSTStop using the Finder component when available (Make findFiles() private)Re-add FrameworkBundle YamlLintCommandTestUse CommandTester::getStatusCode() rather than assign execute()Re-add feature for bundle directories, Test it
@chalasrchalasrforce-pushed thestandalone_yaml-lint_command branch from5129dbe to33402eaCompareJune 23, 2016 11:12
@chalasr
Copy link
MemberAuthor

I made the changes. Re-added the @BundleName/ feature and a test for.

@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commit33402ea intosymfony:masterJun 23, 2016
fabpot added a commit that referenced this pull requestJun 23, 2016
…ml component (chalasr)This PR was merged into the 3.2-dev branch.Discussion----------[FrameworkBundle][Yaml] Move YamlLintCommand to the Yaml component| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#18987| License       | MIT| Doc PR        | ~See#18987 for the use case.Also I see several things that can be simplified/optimized in the original command, but I think it would be better to propose the changes in a next PR and just propose the exact changes needed to move it outside of the framework. If all should be done here, let me know before reviewing it.Commits-------33402ea Add Yaml LintCommand
@chalasrchalasr deleted the standalone_yaml-lint_command branchJune 23, 2016 12:41
@fabpotfabpot mentioned this pull requestOct 27, 2016
xabbuh added a commit to symfony/symfony-docs 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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@chalasr@greg0ire@stof@fabpot@javiereguiluz@GromNaN@jvasseur@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp