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

Documentation: describe all literal arglist params #3061

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3920,10 +3920,28 @@ object Example2 {

## Binpacking

### `binPack.literalArgumentLists`
### Literal argument lists

This group of parameters controls binpacking of an argument list if _all_ arguments are
considered to be literals.

The following parameters affect this behaviour:

- `binPack.literalArgumentLists`: if false, this behaviour is disabled, other parameters ignored
- `binPack.literalsMinArgCount`: doesn't apply binpacking to calls with fewer arguments
- `binPack.literals{Include,Exclude}`: lists of regular expressions which define a literal
- [since v2.5.0] `binPack.literalsIncludeSimpleExpr`: allows a few selects (i.e. `a.b`),
followed by a few nested single-argument apply calls, with literals as arguments
- [since v2.5.0] `binPack.literalsSingleLine`: the entire argument list will be formatted on
one line, regardless of `maxColumn`

```scala mdoc:defaults
binPack.literalArgumentLists
binPack.literalsMinArgCount
binPack.literalsInclude
binPack.literalsExclude
binPack.literalsIncludeSimpleExpr
binPack.literalsSingleLine
```

```scala mdoc:scalafmt
Expand All @@ -3947,14 +3965,6 @@ val secret: List[Bit] = List(0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1,
0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1)
```

See also:

- `binPack.literalsIncludeSimpleExpr` (to allow a few select methods followed by
a few nested single-argument apply calls, with literals as arguments); added
in v2.5.0
- all other `binPack.literalXXX` parameters (see list at the bottom) are
self-explanatory.

### `binPack.parentConstructors`

Parent constructors are `C` and `D` in `class A extends B with C and D`. Changed
Expand Down