reek configuration

269 views
Skip to first unread message

Chris Ian Fiel

unread,
Sep 29, 2013, 11:50:24 AM9/29/13
to metr...@googlegroups.com

Hello guys,

Where do I put the configuration of reek metric? example config 

LongMethod: 
  max_statements: 10
  exclude: 
  - initialize
  enabled: true

I want to put max statement to 10

Any Ideas?


Benjamin Fleischer

unread,
Sep 29, 2013, 12:27:26 PM9/29/13
to metr...@googlegroups.com
Did you try using a .reek file as described in the reek documentation?


--
You received this message because you are subscribed to the Google Groups "metric_fu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metric_fu+...@googlegroups.com.
To post to this group, send email to metr...@googlegroups.com.
Visit this group at http://groups.google.com/group/metric_fu.
For more options, visit https://groups.google.com/groups/opt_out.

Chris Ian Fiel

unread,
Sep 29, 2013, 6:33:05 PM9/29/13
to metr...@googlegroups.com, benj...@benjaminfleischer.com
Yes I have. I have put .reek file to config folder. It would work if I put a parameter -c in the command line reek -c config/metric_fu.reek app/controllers/orders_controller.rb (example). but when I just used reek  app/controllers/orders_controller.rb this does not work. Can I specify parameter in reek in metric_fu? so that I could put the -c config. Thanks for the response :)

Benjamin Fleischer

unread,
Sep 29, 2013, 7:29:42 PM9/29/13
to metr...@googlegroups.com

On Sun, Sep 29, 2013 at 5:33 PM, Chris Ian Fiel <ccf...@gmail.com> wrote:
Yes I have. I have put .reek file to config folder. It would work if I put a parameter -c in the command line reek -c config/metric_fu.reek app/controllers/orders_controller.rb (example). but when I just used reek  app/controllers/orders_controller.rb this does not work. Can I specify parameter in reek in metric_fu? so that I could put the -c config. Thanks for the response :)

Oh, I tried it in the project root and it worked fine, though LongMethod isn't a checked-for smell

Chris Ian Fiel

unread,
Sep 29, 2013, 7:56:53 PM9/29/13
to metr...@googlegroups.com, benj...@benjaminfleischer.com
ah ok so i need to put the .reek file in the root folder of the project? not in config/ folder ?  as per documentation of reek the file should be in config. anyway, I tried to look at the code of metric_fu. I made a small change so that the reek file in config folder can be recognized https://github.com/juanpayph/metric_fu/commit/3914a445e1da895c87cfbfeb306fcd73b055b4a0 . If this is a good patch I will pull request :) Thanks again for the support 

Benjamin Fleischer

unread,
Sep 29, 2013, 8:41:26 PM9/29/13
to metr...@googlegroups.com
I think I would accept that with a link to the relevant reek doc

And thanks for surfacing more of our underdocumented configurable variables.  We should add this to the wiki page under usage.

B mobile phone
--

Ramya Thulasingam

unread,
Nov 5, 2013, 11:54:55 PM11/5/13
to metr...@googlegroups.com

I am having trouble with reek configuration. I am using metric_fu and added a .metrics file and also .reek file in the config folder.

here is my .metrics code

MetricFu::Configuration.run do |config|
  config.configure_metrics.each do |metric|
    if [:reek,:flay].include?(metric.name)
      metric.enabled = true
      dir_name = "dirs_to_#{metric.name}"
      metric.send(dir_name, %w(app/command_factory app/domain app/models app/validators  lib ))
    else
        metric.enabled = false
    end
  end
end

my .reek file in config folder(I also tried moving the file to the root directory that didnt help either)
---
FeatureEnvy:
  enabled: true

I want only the feature envy code smell and nothing else but when I do rake metrics:all I it checks for all the code smells for Reek.

where is the reek config file that metric fu is looking at?

Any help on this will be appreciated.

Thanks
Ramya

Benjamin Fleischer

unread,
Nov 6, 2013, 11:30:20 AM11/6/13
to metr...@googlegroups.com

On Tue, Nov 5, 2013 at 10:54 PM, Ramya Thulasingam <ramyathu...@gmail.com> wrote:
my .reek file in config folder(I also tried moving the file to the root directory that didnt help either)
---
FeatureEnvy:
  enabled: true

I tried this myself with just `reek --config config/.reek lib/metric_fu/utility.rb` and reek still output a Utility Function smell.  I looked on the reek docs for how to disable all smells except one but didn't see an answer outright... but this is a reek issue at this point.

I have code in master now for using the excepted config location

Reply all
Reply to author
Forward
0 new messages