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(match): Indent match conditions #2258

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

claytonrcarter
Copy link
Contributor

This updates match($cond) printing to ... er ... match if ($cond) (etc) when the condition can't fit onto a single line.

Input

match($really_really_really_really_really_really_really_really_long_variable_name) {
default => null
};

Current behavior on master

match(
$really_really_really_really_really_really_really_really_long_variable_name
) {
    default => null
};

Behavior with this change

match(
    $really_really_really_really_really_really_really_really_long_variable_name
) {
    default => null
};

I added a test to the snapsnots, and this change also corrects/changes one of the other match snapshots.

Copy link
Collaborator

@cseufert cseufert left a comment

Choose a reason for hiding this comment

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

Thanks, and looks good

Copy link
Collaborator

@czosel czosel left a comment

Choose a reason for hiding this comment

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

LGTM as well, thanks for contributing and sorry for the delay!

@czosel czosel merged commit f6fbc45 into prettier:main Oct 11, 2023
15 checks passed
@claytonrcarter claytonrcarter deleted the indent-match-condition branch October 11, 2023 22:27
@czosel
Copy link
Collaborator

czosel commented Oct 15, 2023

Released in v0.21.0 🎉

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

3 participants