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
DX: check fixer's options for wording #7543
DX: check fixer's options for wording #7543
Conversation
content of PR and text in PR opening are 2 separated things, do I understand right? for changing options, why dropping plural? |
It's not dropping, it still checks for plural, only with and exception fo having |
I read it as you want to change the plurality (while PR is doing something else) after peer2peer discussion, comment in opening msg is standalone idea, not blocking content of the PR |
tests/Test/AbstractFixerTestCase.php
Outdated
self::assertSame( | ||
0, | ||
substr_count($description, 'phpdocs') - substr_count($description, '`phpdocs_'), // allow the option to have "`phpdocs_*`" | ||
sprintf('[%s] `PHPDoc` must not be in the plural in %s.', $fixerName, $descriptionType), | ||
); |
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 think right now we have only phpdocs_
(plural) as rule option, is it the case?
with that, maybe we should keep the opposite rule here, to have it plural for option?
or likely no - as we have only single rule having option like that, maybe we do not have enough options to decide if there should be a rule for it, sounds too early for me.
Original idea was to keep proper casing, which makes sense to have always the same casing for same, hm..., proper name. (polish "nazwa wlasna")
now , you suggest to unify using plural or singular, which really depends on the context and maybe should not be unified?
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'd say they should be unified, but let's start with not allowing more plural usages.
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.
only if whole option make sense when using singular form. not sure if that will be the case or not as we do not have many cases yet to validate that.
tests/Test/AbstractFixerTestCase.php
Outdated
'PHPDoc' => [ | ||
'option:comment_type' => [ | ||
'align_multiline_comment' => 2, | ||
], | ||
], |
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 dropped it on local machine to check how the error will look alike if someone would use phpdocs_
option in other fixer.
Outcome is confusing:
1) PhpCsFixer\Tests\Fixer\Phpdoc\AlignMultilineCommentFixerTest::testXxxFixerConfigurationDefinitions
[align_multiline_comment] `PHPDoc` must be in correct casing in option:comment_type.
Failed asserting that 1 is identical to 3.
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.
What is confusing in "PHPDoc
must be in correct casing in option:comment_type."? It is quite clear to me what is wrong.
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.
it was confusing as test was complaining about plural/singular and test failure description was complaining about casing.
not the case anymore with newest state of this PR
Fixer
align_multiline_comment
currently has:Maybe better would be to update available option to
all
,phpdoc_like
andphpdoc_only
?