-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Issue #14971: Add input file in indentation check for pattern matchin… #14997
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
Conversation
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.
Looks good.
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.
Just to be clear, we are only validating LITERAL_WHEN
and things around it, correct?
Point(int x, int y) //indent:20 exp:20 | ||
when x > 0 && y > 0 -> System.out.println(x + y); //indent:12 exp:16 warn | ||
case Point(int x, int y) -> System.out.println("error"); //indent:12 exp:12 | ||
} //indent:8 exp:8 |
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.
Add an input like: (indentation is intentional)
switch (p) { //indent:8 exp:8
case //indent:12 exp:12
Point(int x, int y)
when
x > 0 && y > 0
->
System.out.println(x + y);
case Point(int x, int y) -> System.out.println("error"); //indent:12 exp:12
} //indent:8 exp:8
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.
Just to be clear, we are only validating
LITERAL_WHEN
and things around it, correct?
Yes
Add an input like: (indentation is intentional)
done.
System.out.println(x + y);
this is weird indent:0 expected:0
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.
this is weird indent:0 expected:0
Exactly. :)
This is a bug. Most likely this line is not being validated.
You will only see issues with this check if you do bad indentation. You other examples were "too good".
After talking with @nrmancuso , move this to a new issue. We need to continue opening other issues and will probably return to indentation later.
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.
@mahfouz72 Is this done?
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.
…rn matching for switch
closes #14971