-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
docs: Sort options in documentation #7345
Conversation
8983c5e
to
7fcac76
Compare
42bf395
to
c58b835
Compare
Code looks clean and good to me.
is that more helpful than lets say:
point could be made that maybe the name could've been better in hindsight
but yeah, don't know, just wanted to share my thoughts on it |
I like this idea, if it's would also fit on the grammar side (i hope for most cases it would). maybe worth to create a follow up - but it could be bigger effort have all those proxy/deprecated options, for not that big gain. Without having this in place, I would suggest to keep alpha sorting as simples option |
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.
Like the idea and your own suggestion how to improve further ;)
c9e27ee
to
62f5847
Compare
There are also other options, e.g.
where special ordering could make sense. |
'inline_constructor_arguments' => true, | ||
'multi_line_extends_each_single_line' => false, | ||
'single_item_single_line' => false, | ||
'single_line' => false, | ||
'space_before_parenthesis' => false, | ||
'inline_constructor_arguments' => true, |
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.
As an alternative to this change, I could extract a FixerOptionSorter
and use it in both the FixerConfigurationResolver
and ClassDefinitionFixerTest::assertSame()
.
What do you think?
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 we either have a low-level test that options are always sorted,
or we have a sorter mechanism that is used on that low-level (ref #7345 (comment) )
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.
Having a test that checks all options for all fixers seems the way to go for me. Than there is no need to test order of the options @ runtime. (likely in FixerConfigurationResolverTest.php
)
There are also other options, e.g.
max_line_breaks
min_line_breaks
where special ordering could make sense.
👍 that could be added to the tests, I think I a saw an option called default
somewhere as well, maybe it might make sense to have that one as first as well for example. I just thinking out loud here
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.
Not sure I understand - would you like me to to make any changes here? If so, which? Thank you!
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.
Think keradus has other idea than I ;)
I have no strong opinion on the implementation of this, I think the idea is great!
So I'll leave the implementation details to you two :)
@@ -65,13 +65,22 @@ public function testWithDuplicateAliasOptions(): void | |||
|
|||
public function testGetOptions(): void |
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.
👍
82abf43
to
9443801
Compare
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 look into failing CI
17c6c6e
to
aa9e14d
Compare
Thank you, @keradus and @SpacePossum! |
This pull request
FixerConfigurationResolver
to keep options sorted by name