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

Fix binary operator spaces CS #9330

Merged
merged 5 commits into from
Feb 2, 2024

Conversation

mvorisek
Copy link
Contributor

No description provided.

@mvorisek mvorisek force-pushed the fix_binary_operator_spaces branch from 146a49a to 2421f7c Compare January 31, 2024 11:46
@mvorisek
Copy link
Contributor Author

There are two styles we can use.

'binary_operator_spaces' => [
    'default'   => 'single_space',
    'operators' => [
        '=>' => 'align_single_space_minimal',
        '='  => 'align_single_space_minimal',
    ],
],

or

'binary_operator_spaces' => [
    'default'   => 'single_space',
],

docs: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.48.0/doc/rules/operator/binary_operator_spaces.rst

This project use more the 1st style (1st/2nd commit), but it is not diff friendly, not refactoring friendly and small changes very often leads to many LoC changed. Also, the aligned indentation on unrelated assignments is quite confusing.

I personally prefer the 2nd style (3rd commit) for the reasons said above, it is also the default Symfony and PHP CS Fixer style.

@alecpl what style do you prefer?

@alecpl
Copy link
Member

alecpl commented Jan 31, 2024

I'm fine with single_space.

@mvorisek mvorisek marked this pull request as ready for review January 31, 2024 12:48
@mvorisek
Copy link
Contributor Author

mvorisek commented Feb 2, 2024

PR is done with single_space.

@alecpl alecpl merged commit d18406a into roundcube:master Feb 2, 2024
15 checks passed
@mvorisek mvorisek deleted the fix_binary_operator_spaces branch February 2, 2024 08:47
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.

2 participants