public
Description: Code smell detector for Ruby
Home | Edit | New

Configuration Files

The behaviour of Reek’s code smell detectors can be configured by placing YAML files among your source files. See the relevant wiki page for details of the configuration options for each of the detected Code Smells.

Before examining each source file, Reek initializes its smell detectors using the file config/defaults.reek as installed by the Reek gem. Reek then overlays this initial configuration by loading up all files called *.reek found anywhere on the source file’s full path. Configuration files are overlaid in the order of “furthest away” first.

As an example, let’s look at one particular smell. The default configuration options for FeatureEnvy are:

---
FeatureEnvy:
  enabled: true

Now suppose I ask Reek to check the file /home/kr/work/subject.rb and I have the following additional config files in my environment:

/site.reek

---
FeatureEnvy:
  exclude:
  - view
  - report

/home/kr/work/exceptions.reek
---
FeatureEnvy:
  enabled: false

After initializing FeatureEnvy from config/defaults.reek, Reek will then overlay their settings by reading /site.reek, followed by /home/kr/work/exceptions.reek. The result is
---
FeatureEnvy:
  exclude:
  - view
  - report
  enabled: false

All of which means that the FeatureEnvy detector would not be enabled for this run of Reek.

Last edited by kevinrutherford, Wed Mar 04 13:08:27 -0800 2009
Home | Edit | New
Versions: