Skip to content

Setup Reek for Rails apps

Abraham edited this page Sep 23, 2016 · 2 revisions

This article will provide a base configuration file for reek when working on Rails applications.

Base configuration

The base configuration includes:

  • The directories to analyze with reek
  • The code styles to include or ignore
"config/":
  IrresponsibleModule:  
    enabled: false
  NestedIterators:
    enabled: false 
  UtilityFunction:
    enabled: false

"app/":
  InstanceVariableAssumption:
    enabled: false
  IrresponsibleModule:  
    enabled: false
  NestedIterators:
    enabled: false 
  UtilityFunction:
    enabled: false

"app/jobs":
  IrresponsibleModule:  
    enabled: false
  NestedIterators:
    enabled: false 
  UtilityFunction:
    enabled: false

"app/controllers":
  InstanceVariableAssumption:
    enabled: false
  IrresponsibleModule:
    enabled: false
  NestedIterators:
    max_allowed_nesting: 2
  UnusedPrivateMethod:
    enabled: false
  UncommunicativeModuleName:
    enabled: false

"lib/":
  IrresponsibleModule:
    enabled: false
  DuplicateMethodCall:
    enabled: false

"db/migrate":
  IrresponsibleModule:
    enabled: false
  TooManyStatements:
    enabled: false
  DuplicateMethodCall:
    enabled: false
  FeatureEnvy:
    enabled: false
  UncommunicativeVariableName:
    enabled: false

"spec/":
  IrresponsibleModule:
    enabled: false
  UncommunicativeMethodName:
    enabled: false
  DuplicateMethodCall:
    enabled: false
  UtilityFunction:
    enabled: false

"app/helpers":
  IrresponsibleModule:
    enabled: false
  UtilityFunction:
    enabled: false

This configuration file can easily change and be adapted to other contexts.

Clone this wiki locally