Skip to content

Commit

Permalink
add max_function_clause_length to rules.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bormilan committed Oct 1, 2024
1 parent f798f79 commit 590a507
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ identified with `(since ...)` for convenience purposes.
- [Max Anonymous Function Arity](doc_rules/elvis_style/max_anonymous_function_arity.md)
- [Max Function Arity](doc_rules/elvis_style/max_function_arity.md)
- [Max Function Length](doc_rules/elvis_style/max_function_length.md)
- [Max Function Clause Length](doc_rules/elvis_style/max_function_clause_length.md)
- [Max Module Length](doc_rules/elvis_style/max_module_length.md)
- [Module Naming Convention](doc_rules/elvis_style/module_naming_convention.md)
- [Nesting Level](doc_rules/elvis_style/nesting_level.md)
Expand Down
27 changes: 27 additions & 0 deletions doc_rules/elvis_style/max_function_clause_length.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Max Function Clause Length

This specifies an upper bound on function clause **line** length. Lines that are comments and/or whitespace
can be either included or excluded from the line count.

> Works on `.beam` file? Not really! (it consumes results Ok, but these might be unexpected, since
the files are pre-processed)

## Options

- `max_length :: non_neg_integer()`.
- default: `30`.
- `count_comments :: boolean()`
- default: `false`
- `count_whitespace :: boolean()`
- default: `false`

## Example

```erlang
{elvis_style, max_function_clause_length}
%% or
{elvis_style, max_function_clause_length, #{ max_length => 30
, count_comments => false
, count_whitespace => false
}}
```

0 comments on commit 590a507

Please sign in to comment.