Skip to content

Commit

Permalink
Update coding-style for arrow position on method/property (#6504)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-epure-sonarsource committed Dec 15, 2022
1 parent 04c986c commit e27457c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/coding-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ Variable name `sut` (System Under Test) is recommended in unit tests that really
// Action
}
```
* Expression body of arrow property should be on the same line, as the property declaration. It should be on next line only when S103 is violated.
* Expression body of method should be on the same line only for trivial cases: literal or simple identifier. Member access, indexer, invocation and other complex structures should be on the next line.
* When using an arrow property or an arrow method, the `=>` token must be on the same line as the declaration. Regarding the expression body:
* for properties: it should be on the same line as the property declaration. It should be on the following line only when it is too long and would trigger S103.
* for methods: it should be on the same line only for trivial cases: literal or simple identifier. Member access, indexer, invocation, and other complex structures should be on the following line.

## Code structure

Expand Down

0 comments on commit e27457c

Please sign in to comment.