Skip to content

Commit c85a4fa

Browse files
authored
Enforce parens on zero-arity remote function calls (#28)
1 parent d2d3582 commit c85a4fa

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,28 @@
215215
config = IEx.Config.new
216216
```
217217

218-
The same applies to __local__ one-arity function calls in pipelines.
218+
The same should be done for __remote__ zero-arity function calls:
219219

220220
```elixir
221-
String.strip(input) |> decode()
221+
# Bad
222+
Mix.env
223+
224+
# Good
225+
Mix.env()
226+
```
227+
228+
This rule also applies to one-arity function calls (both local and remote) in pipelines:
229+
230+
```elixir
231+
# Bad
232+
input
233+
|> String.strip
234+
|> decode
235+
236+
# Good
237+
input
238+
|> String.strip()
239+
|> decode()
222240
```
223241

224242
* <a name="anonymous-fun-parens"></a>

0 commit comments

Comments
 (0)