Skip to content
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

chore: PHPDoc key-value spacing #7592

Merged
merged 1 commit into from Dec 18, 2023
Merged

chore: PHPDoc key-value spacing #7592

merged 1 commit into from Dec 18, 2023

Conversation

keradus
Copy link
Member

@keradus keradus commented Dec 18, 2023

No description provided.

@keradus keradus marked this pull request as ready for review December 18, 2023 00:09
@keradus keradus enabled auto-merge (squash) December 18, 2023 00:09
@coveralls
Copy link

Coverage Status

coverage: 94.801%. remained the same
when pulling b3fa343 on keradus:_w,_w
into 88fc5fe on PHP-CS-Fixer:master.

Comment on lines +1196 to +1201
* @param string $input
* @param \Closure $fn
* @param \Closure(bool):int $fn2
* @param Closure $fn3
* @param Closure(string):string $fn4
* @param array<string, array<string, mixed>> $data
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of phpDoc horizontal alignment in the project? I find it totally unneeded. Not something that bothers me, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't, the phpdoc would then we very less readable.

Copy link
Member

Choose a reason for hiding this comment

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

Not for me 🤷‍♂️.

Copy link
Contributor

@mvorisek mvorisek Dec 18, 2023

Choose a reason for hiding this comment

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

You must be a superhero, everyone else in the world needs and use the horizontal alignment :)

Copy link
Member

Choose a reason for hiding this comment

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

To be honest I have never worked in a place where horizontal alignment was used. None of my teams had it configured (10+ years). Right now I work with GetResponse and there are dozens of developers in the 2-million SLOC app, and we don't use alignment. Not a single developer ever complained about it 🤷‍♂️. For me it's a waste of space and personally I find it less readable, especially when there's a huge gap between type and variable forced by some other, longer type. Displaying white chars somehow helps (you can match better), but still a noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Wirone , please be mindful that you complain about whitespaces in test of fixer doing those whitespaces :D it's a crazy example here, but that's the purpose of the test.
I aim to not have as such crazy docs in actual code - regardless if with or without whitespaces - by having docs only for those params that are not typehinted on method prototyped or requires extra typing (eg array vs list) or detailed description. We do not have so many of them.

After saying that, I prefer to have those horizontal alignments for docs, and it's coming as a habit from a quite popular ecosystem - Symfony.

I acknowledge that different ppl have different preferences, thus I want to go with PSR/PER + Symfony and potentially build on top (eg strict rules), but not against rules from base rulesets. This simplify a lot the discussion "which rule to use"

Copy link
Member

Choose a reason for hiding this comment

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

First of all I am not complaining, I just asked if we need this particular rule/option enabled in our internal ruleset, because I personally don't like how phpDocs look like in the codebase (even if there are not lot of it) 😉. I don't agree with reasoning that @PhpCsFixer should only add to parent rule sets, for me it's only a way to achieve custom ruleset, and if it's easier to extend from other ruleset and then remove/change 1 rule, rather than defining N rules without using base ruleset, then it's totally fine. I don't need simplified discussion, I prefer things I like 😅. But in the end it's your choice.

Copy link
Member Author

Choose a reason for hiding this comment

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

exactly, everyone will have different preferences, we have soooo many rules ;) thus this simplification on own ruleset decision making I done for project.

@keradus keradus merged commit ac9c2e0 into PHP-CS-Fixer:master Dec 18, 2023
25 checks passed
@keradus keradus deleted the _w,_w branch December 18, 2023 21:36
danog pushed a commit to zoonru/PHP-CS-Fixer that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants