Skip to content

Run community build with -indent -rewrite after #17522 #17617

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

Closed
wants to merge 6 commits into from

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented May 30, 2023

Rewrite the entire community to indent to validate #17522

@adpi2 adpi2 force-pushed the insert-indent-cb branch from b9ff13b to 3dbeacd Compare May 30, 2023 15:02
adpi2 added 5 commits May 30, 2023 17:02
Ensure indentation is correct when removing braces.

If the first indentation of the region is greater than the indentation
of the enclosing region, we use it to indent the whole region.
Otherwise we use the incremented indentation of the enclosing region.

```scala
  def foo = {
        x // we replicate indentation of x downward in region
    y
  }
```

```scala
  def foo = {
x // indentation of x is incorrect, we increment enclosing indentation
  y
  }
```

A bigger indentation than the required one is permitted except
just after a closing brace.

```scala
def bar = {
  x
    .toString // permitted indentation
  def foo = {
  }
    bar //  must be unindented, to not fall into the body of foo
}
```
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.

1 participant