Sha256: f2a123f1ec460b68542b5ebc45fb0b5db46623c94ae43790d9229713e25b5ef3

Contents?: true

Size: 1.24 KB

Versions: 31

Compression:

Stored size: 1.24 KB

Contents

# Basic Smell Options

## Introduction

Every smell detector in Reek offers at least the following configuration options:

| Option         | Value       | Effect  |
| ---------------|-------------|---------|
| `enabled` |  Boolean | Determines whether the smell detector is active. Defaults to `true` |
| `exclude` | an array of strings or regular expressions | Ignores any context whose full description (see <strong>%c</strong> in [Command-Line Options](Command-Line-Options.md)) matches any element of this array. |

The file `defaults.reek` (shipped with the Reek gem) lists any default
exclusions for each smell.

## Examples

<u>An easy one:</u>

To stop Reek reporting smells in any method called `write` you might create a configuration file containing this:

```yaml
ControlCouple: 
  exclude:
  - write
```

Or a little more sophisticated using a Ruby regex like this:

```yaml
ControlCouple: 
  exclude:
  - !ruby/regexp /write/
```

<u>A more sophisticated one:</u>

```yaml
FeatureEnvy:
  exclude:
    - "MyModel#do_things"
    - "MyHelper"
    - "ApplicationController#respond"
```

This would not report FeatureEnvy for the instance method `MyModel#do_things`, the whole module `MyHelper` and the `respond` instance method of `ApplicationController`

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
reek-4.4.0 docs/Basic-Smell-Options.md
reek-4.3.0 docs/Basic-Smell-Options.md
reek-4.2.5 docs/Basic-Smell-Options.md
reek-4.2.4 docs/Basic-Smell-Options.md
reek-4.2.3 docs/Basic-Smell-Options.md
reek-4.2.2 docs/Basic-Smell-Options.md
reek-4.2.1 docs/Basic-Smell-Options.md
reek-4.2.0 docs/Basic-Smell-Options.md
reek-4.1.1 docs/Basic-Smell-Options.md
reek-4.1.0 docs/Basic-Smell-Options.md
reek-4.0.5 docs/Basic-Smell-Options.md
reek-4.0.4 docs/Basic-Smell-Options.md
reek-4.0.3 docs/Basic-Smell-Options.md
reek-4.0.2 docs/Basic-Smell-Options.md
reek-4.0.1 docs/Basic-Smell-Options.md
reek-4.0.0 docs/Basic-Smell-Options.md
reek-4.0.0.pre1 docs/Basic-Smell-Options.md
reek-3.11 docs/Basic-Smell-Options.md
reek-3.10.2 docs/Basic-Smell-Options.md
reek-3.10.1 docs/Basic-Smell-Options.md