inaka / elvis

Erlang Style Reviewer
Apache License 2.0
426 stars 87 forks source link

Document use of generic `ignore` option #540

Closed paulo-ferraz-oliveira closed 3 years ago

paulo-ferraz-oliveira commented 4 years ago

Related to issues inaka/elvis#507 and inaka/elvis#488. Related to PR inaka/elvis_core#137.

Can be used to update the Rules wiki. Once the related PR is accepted.

Note: remove references to ignore_functions from the Wiki + move no_tabs, line_length and no_trailing_whitespace to elvis_text_style.

Tentative documentation follows.

The "ignore" option

Module-level rules implement a generic ignore mechanism that allows skipping analysis in elements of your choice. It suffices to add the ignore list to your rules, as per the example below.

-elvis([{elvis_style, invalid_dynamic_call, #{ ignore => [elvis_core]}}]).
-elvis([{elvis_style, no_debug_call, #{ ignore => [elvis_result, elvis_utils]}}]).

You can add the exceptions using the following syntax:

paulo-ferraz-oliveira commented 3 years ago

Updating Rules wiki with this content, since it's been merged to master already.