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(formatter): correct argument printing and member access chain logic #131

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

azjezz
Copy link
Member

@azjezz azjezz commented Mar 8, 2025

📌 What Does This PR Do?

This PR addresses and fixes multiple bugs in the formatter related to argument lists, indentation, and member access chain breaking, as reported in issue #128.

🔍 Context & Motivation

The bugs fixed in this PR were causing incorrect formatting in specific scenarios involving argument lists, indentation within nested structures, and member access chain line breaking. These issues were reported by a user and negatively impacted the formatter's reliability and usability.

🛠️ Summary of Changes

  • Bug Fix: Fixed multiple bugs in the formatter related to argument lists printing, indentation, and member access chain breaking.

📂 Affected Areas

  • Linter
  • Formatter
  • CLI
  • Composer Plugin
  • Dependencies
  • Documentation
  • Other (please specify):

🔗 Related Issues or PRs

Closes #128

📝 Notes for Reviewers

@azjezz azjezz added Priority: High After critical issues are fixed, handle these before any further issues. Type: Bug An issue causing unintended or problematic behavior. Subject: Formatter An issue or PR related to the formatter. Status: Closed This issue is closed and no more work is planned. labels Mar 8, 2025
@azjezz azjezz self-assigned this Mar 8, 2025
FormatSettings {
preserve_breaking_argument_list: true,
preserve_breaking_member_access_chain: true,
always_break_named_arguments_list: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

@innocenzi instantation was always breaking into multiple lines because of this option, not a bug.

function getControls(): array
{
return [
...($this->bufferEnabled ? ['esc' => 'select'] : ['/' => 'filter', 'space' => 'select']),
Copy link
Member Author

Choose a reason for hiding this comment

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

does not resolve #130, we just noticed that parens were missing in this case, and fixes it here.

@azjezz azjezz merged commit 7edaeb5 into main Mar 8, 2025
4 checks passed
@azjezz azjezz deleted the fix/formatter-128 branch March 9, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, handle these before any further issues. Status: Closed This issue is closed and no more work is planned. Subject: Formatter An issue or PR related to the formatter. Type: Bug An issue causing unintended or problematic behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

preserve_breaking_* rules sometimes don't work
1 participant