From 36f5e0c4803bfaecc26f0fb718481b83ec92223c Mon Sep 17 00:00:00 2001 From: a-khakimov Date: Wed, 20 Dec 2023 14:30:39 +0500 Subject: [PATCH] Update docs --- docs/README.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/README.md b/docs/README.md index a75537f..86c6b36 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,6 +20,25 @@ error: [NoGeneralException] Exception is not allowed */ ``` +#### Configuration + +- `NoGeneralException.forbidden` - list of forbidden exception types (default `Exception` and `Throwable`) + +--- + +### NoOptionGet + +This rule prohibits the use of the `get` method on `Option` to avoid a `NoSuchElementException`. + +```scala +val value = myOption.get +/* +[error] ... error: [NoOptionGet] Option.get is not allowed +[error] val value = myOption.get +[error] ^^^^^^^^^^^^ + */ +``` + --- ### NoHead @@ -55,21 +74,6 @@ map(1) --- -### NoOptionGet - -This rule prohibits the use of the `get` method on `Option` to avoid a `NoSuchElementException`. - -```scala -val value = myOption.get -/* -[error] ... error: [NoOptionGet] Option.get is not allowed -[error] val value = myOption.get -[error] ^^^^^^^^^^^^ - */ -``` - ---- - ### NoUnnamedArgs This rule requires specifying arguments names when calling a function. It makes the code more readable.