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
Added More Phpdoc Fixers #887
Conversation
* | ||
* @return bool | ||
*/ | ||
private function isAnnotation($content) |
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.
this looks like static
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.
👍
phpdoc_group_tags_fixer as name perhaps? i think its more clear then phpdoc 2014-12-17 1:29 GMT+01:00 Coveralls notifications@github.com:
|
Flysystem regression testing: thephpleague/flysystem#351. |
Oh my... huge progress from last time I see this PR ! |
:) |
Could you explain (in code ;) ) why the used fixers order are needed? What do we gain by it ? |
I thought I had. Err, well. The trim fixer needs to run quite late because the return void fixer can leave behind blank docblock lines if someone has separated it from the param annotations for example. |
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Symfony\CS\DocBlock; |
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.
please, create a testsuit in phpunit.xml.dist for DocBlock namespace
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, personally, would set "general" first and then all others alphabetically.
But for me it doesn't really matters...
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.
Done:
<testsuites>
<testsuite name="general">
<directory>./Symfony/CS/Tests/</directory>
<exclude>
<directory>./Symfony/CS/Tests/Fixer/</directory>
<directory>./Symfony/CS/Tests/Fixtures/</directory>
<directory>./Symfony/CS/Tests/Tokenizer/</directory>
</exclude>
</testsuite>
<testsuite name="fixer">
<directory>./Symfony/CS/Tests/Fixer/</directory>
</testsuite>
<testsuite name="tokenizer">
<directory>./Symfony/CS/Tests/Tokenizer/</directory>
</testsuite>
<testsuite name="docblock">
<directory>./Symfony/CS/Tests/DocBlock/</directory>
</testsuite>
</testsuites>
There are loads of cases here - difficult to write them all down. |
Somehow you decided about that and not other order. Just please, write it down. If not then somebody in future may don't understand it and remove it. |
I'll add that to the todo as the order might change again after more testing on different repos. |
great ! |
@keradus Alright - where I'm at now - This is essentially feature complete, and current code coverage is 100%. I've still got some more unit tests to write for the docblocks classes in isolation, but we should be nearing completion. |
All the tests are done now. Now we need to discuss fixer names. The following are new fixers introduced by this pull: phpdoc_no_return_void
phpdoc_separation
phpdoc_trim
phpdoc_var
phpdoc_order
|
Other names are good for me |
|
I've renamed that other fixer. |
Renaming |
Just added |
|
||
public function testSingleLine() | ||
{ | ||
$expected = <<<'EOF' |
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.
why a nowdoc instead of simply '<?php ...'
?
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.
fixed
@keradus Is there any chance you could finish this off for me. I don't think I'll be able to do anything here in the next 24 hours. Sorry. |
@GrahamCampbell you know that when I could help I do it, I send PRs into yours few times, event into this one. |
Just rebased. |
ping @GrahamCampbell |
I'll rebase again, look into the failing tests, then address those remaining issues. |
cool, any chances to see you on gitter ? |
ping @GrahamCampbell |
Awesome @keradus. :) |
Please rebaser to get rid of that merge commit and squash your commits into one, there should be one commit per one author. |
ping @GrahamCampbell |
@keradus Will do very shortly. :) |
@keradus Done! |
Thank you @GrahamCampbell. Great work here! ;) |
This PR was merged into the 1.5 branch. Discussion ---------- Added More Phpdoc Fixers TODO: * [x] Added phpdoc_seperation * [x] Fix the behaviour with some annotations like the phpunit ones - introduced a tag class * [x] Refactor the docblock classes to model the situation more clearly * [x] Add tests for the `Tag` class * [x] Add tests for the `DocBlock` class * [x] Added phpdoc_order * [x] Perform regression testing on league/flysystem * [x] Based on results from testing, make improvements * [x] Add phpdoc_var fixer * [x] Perform regression testing on symfony/symfony * [x] Based on results from testing, make improvements, add more test cases * [x] Move the phpdoc_order fixer to contrib level * [x] Add a phpdoc_trim fixer at symfony level, partly taken from phpdoc_separation * [x] Added phpdoc_no_return_void * [x] Review fixer orders * [x] Perform regression testing on guzzle/guzzle * [x] `@see`, `@link`, `@deprecated`, `@since`, `@author`, `@copyright`, and `@license` annotations should be kept together rather than forced apart by the separation fixer * [x] Support annotations with descriptions including bank lines * [x] Perform regression testing on doctrine/common * [x] Perform regression testing on guzzle/guzzle and symfony/symfony again * [x] Fix more bugs, and add more test cases * [x] Perform regression testing on flysystem guzzle, doctrine, symfony again * [x] Analyse current code coverage and cleanup code * [x] Add tests for the `TagComparator` * [x] Add missing `DocBlock` class tests * [x] Add tests for the `Line` class * [x] Add tests for the `Annotation` class * [x] Test on dingo/api, factory-muffin, aws sdk v2 and v3 * [x] Discuss fixer names * [x] Add fixers to change var to type and type to var * [x] Add a fixer to ensure short descriptions end in a `.`, `?`, or `!` * [x] Review by @keradus * [x] Cleanup the docblock classes * [x] Add a fixer to remove package and subpackage annotations * [x] Complete reviews and testing I THINK WE'RE DONE! :) Commits ------- 0006059 Enhance tests of order of phpdoc fixers 9f3aab8 Added more phpdoc fixers
Pleasure. :) |
Merging for over 30 minutes but merged into 2.0 as well. |
Wow. :) |
What's the timescale on the 1.5 release btw? |
You know this was the last one PR into 1.5.
|
Sweet! |
Ow, and one more step, actually first step at all.. But I have done it for 1.5 this morning merging everything locally ;) Even 2 PR were sent ;) |
This PR was squashed before being merged into the 2.3 branch (closes #13066). Discussion ---------- [2.3] CS And DocBlock Fixes | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A ##### This pull request provides some cs and docblock fixes. @fabpot The second commit of the two applies the docblock fixes you wanted, using PHP-CS-Fixer/PHP-CS-Fixer#887. I made 3 or 4 minor manual changes because people had put bulleted lists in the "short description" which is not allowed, so we were ending up with colons followed by full stops. I've moved those lists to be part of a "long description". // cc @keradus Commits ------- 081dd99 [2.3] CS And DocBlock Fixes
TODO:
Tag
classDocBlock
class@see
,@link
,@deprecated
,@since
,@author
,@copyright
, and@license
annotations should be kept together rather than forced apart by the separation fixerTagComparator
DocBlock
class testsLine
classAnnotation
class.
,?
, or!
I THINK WE'RE DONE! :)