Sha256: 1772f693c414e7f7e7d0e36fd9462b896e9ad6b3dd3c8c17a3a9c9e1d5395fc7

Contents?: true

Size: 1019 Bytes

Versions: 12

Compression:

Stored size: 1019 Bytes

Contents

## Introduction

In some cases, it might be necessary to suppress one or more of `reek`'s smell warnings for a particular method or class. 

Possible reasons for this could be:

* The code is outside of your control and you can't fix it
* `reek` is not the police. You might have legit reasons why your source code is good as it is.

## How to disable smell detection

First and foremost, there are the [Basic Smell Options](Basic-Smell-Options.md) you can use.

Besides from that, you can use special comments, like so:

```ruby
# This method smells of :reek:NestedIterators
def smelly_method foo
  foo.each {|bar| bar.each {|baz| baz.qux}}
end
```

The method `smelly_method` will not be reported. The general pattern is to put the string ':reek:', followed by the smell class, in a comment before the method or class.

It is also possible to specify options for a particular smell detector, like so:

```ruby
# :reek:LongParameterList: { max_params: 4 }
def many_parameters_it_has foo, bar, baz, qux
  # ...
end
```

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
reek-3.3.1 docs/Smell-Suppression.md
reek-3.3.0 docs/Smell-Suppression.md
reek-3.2.1 docs/Smell-Suppression.md
reek-3.2 docs/Smell-Suppression.md
reek-3.1 docs/Smell-Suppression.md
reek-3.0.4 docs/Smell-Suppression.md
reek-3.0.3 docs/Smell-Suppression.md
reek-3.0.2 docs/Smell-Suppression.md
reek-3.0.1 docs/Smell-Suppression.md
reek-3.0.0 docs/Smell-Suppression.md
reek-2.2.1 docs/Smell-Suppression.md
reek-2.2.0 docs/Smell-Suppression.md