10000 [Console] SymfonyStyle: Align multi-line/very-long-line blocks by chalasr · Pull Request #18879 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] SymfonyStyle: Align multi-line/very-long-line blocks #18879

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

Closed
wants to merge 1 commit into from

Conversation

chalasr
Copy link
Member
@chalasr chalasr commented May 25, 2016
Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18564
License MIT
Doc PR n/a

This PR makes all lines aligned in multi-line blocks.

Very-long-line block:

SymfonyStyle::warning('Lorem ipsum...');

Before:
before-1
After:
after-1

Multi-line block:

SymfonyStyle::success(['Lorem ipsum...', 'Lorem ipsum...', 'Lorem ipsum...']);

Before:
before-2
After:
after-2

Also @javiereguiluz pointed the case of SymfonyStyle::comment() in #18564, I needed to make it calling SymfonyStyle::block() with // as prefix to fit the first intention of this one.
So if this one is merged I'll propose the changes for comments in a second PR (out of this scope).

Remove SymfonyStyle::comment() changes (out of scope)

CS Fixes

Add tests
@chalasr
Copy link
Member Author
chalasr commented May 25, 2016

My first intention was to propose this on 2.8, it's a mistake...

@javiereguiluz javiereguiluz added Bug and removed Feature labels May 26, 2016
@javiereguiluz
Copy link
Member

@chalasr thanks for this PR. In my opinion this is a bug fix which should be merged in 2.7. The "new" behavior is the one we expected since the beginning.

@fabpot
Copy link
Member
fabpot commented May 26, 2016

Thank you @chalasr.

fabpot added a commit that referenced this pull request May 26, 2016
…ocks (chalasr)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #18879).

Discussion
----------

[Console] SymfonyStyle: Align multi-line/very-long-line blocks

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18564
| License       | MIT
| Doc PR        | n/a

This PR makes all lines aligned in multi-line blocks.

Very-long-line block:
```php
SymfonyStyle::warning('Lorem ipsum...');
```

Before:
![before-1](http://image.prntscr.com/image/d8443d3a85924a0182a62bd6d3dc1086.png)
After:
![after-1](http://image.prntscr.com/image/dbbdd275bff140bdad06de336f032ec1.png)

Multi-line block:
```php
SymfonyStyle::success(['Lorem ipsum...', 'Lorem ipsum...', 'Lorem ipsum...']);
```

Before:
![before-2](http://image.prntscr.com/image/6d7c05b4ab3a42f0b0be652527aed7c8.png)
After:
![after-2](http://image.prntscr.com/image/bba017309f4a4dd09e0147d5917cb0ae.png)

Also @javiereguiluz pointed the case of `SymfonyStyle::comment()` in #18564, I needed to make it calling `SymfonyStyle::block()` with ` // ` as prefix to fit the first intention of this one.
So if this one is merged I'll propose the changes for comments in a second PR (out of this scope).

Commits
-------

963fe1d [Console] SymfonyStyle: Align multi-line/very-long-line blocks
@fabpot fabpot closed this May 26, 2016
@fabpot fabpot mentioned this pull request May 26, 2016
@chalasr chalasr deleted the patch_sfstyle_align branch May 26, 2016 09:23
@chalasr
Copy link
Member Author
chalasr commented May 26, 2016

@javiereguiluz Do you know if the 10000 re is a reason for that the 2.7 branch doesn't have the SymfonyStyle::comment() method?
I'll propose the changes for #18564 (comment) and I'm not sure if it should be done on 2.7 or 2.8.

@javiereguiluz
Copy link
Member

@chalasr yes I know the reason well 😁 It was my mistake. At first there wasn't a comment() method and the regular text was displayed commented. Then I realized this was an error and we now have text() and comment() methods.

@chalasr
Copy link
Member Author
chalasr commented May 26, 2016

Hmm ok so I'll keep it on 2.8 (stop me if I'm wrong).
Thank you @javiereguiluz

@@ -57,7 +57,7 @@ public function inputCommandToOutputFilesProvider()

public function testLongWordsBlockWrapping()
{
$word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon';
Copy link
Contributor

Choose a reason for hiding this comment

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

As we discussed, this change should not have been necessary for the test to pass. So I suggest to see #18896

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank's for having made the change @ogizanagi

This was referenced Jun 6, 2016
fabpot added a commit that referenced this pull request Jun 8, 2016
… to directly test output (ogizanagi)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] [SymfonyStyle] Replace long word wrapping test to directly test output

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18879 (comment)
| License       | MIT
| Doc PR        | -

This [line](https://github.com/symfony/symfony/pull/18879/files#diff-d3625f2548a3b329058ca5a0f5aa57feR60) should not have been changed in order to the test to pass. I assume the test was flawed at first, so I suggest to simply test the output as we did for other ones.

Ping @chalasr

Commits
-------

b78fff4 [Console] [SymfonyStyle] Replace long word wrapping test to directly test output
symfony-splitter pushed a commit to symfony/console that referenced this pull request Jun 8, 2016
… to directly test output (ogizanagi)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] [SymfonyStyle] Replace long word wrapping test to directly test output

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#18879 (comment)
| License       | MIT
| Doc PR        | -

This [line](https://github.com/symfony/symfony/pull/18879/files#diff-d3625f2548a3b329058ca5a0f5aa57feR60) should not have been changed in order to the test to pass. I assume the test was flawed at first, so I suggest to simply test the output as we did for other ones.

Ping @chalasr

Commits
-------

b78fff4 [Console] [SymfonyStyle] Replace long word wrapping test to directly test output
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.

5 participants
0