Vscode-ruby: Reek: directory directives in config are ignored

Created on 2 Mar 2017  路  8Comments  路  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: 0.10.4
  • Ruby version: 2.2.1
  • VS Code version: 1.10.1
  • Operating System: macOS 10.11.2

Expected behavior

Ruby reek linter uses the directory directive configurations.

Actual behavior

Ruby reek linter is ignore directive directory configurations.

Steps to reproduce the problem

  1. Initialize a new rails application
  2. Add a .reek configuration file in the project root folder with the following content:
"app/controllers":
  IrresponsibleModule:
    enabled: false
  1. The IrresponsibleModule rule is highlighted in the controller

Theory

I think the cause is that each file is being linted individually without reek knowing the context of its root directory? I don't know how to debug the extension so I can't dig any further.

The following command works as expected:
/my_project_root $ reek app/controllers

The following command doesn't pickup the directory directives:
/my_project_root/app $ reek controllers

PS: Thank for building this extension, it's great!!!

bug

Most helpful comment

Hey @johanbaaij, here鈥檚 the PR related to this issue https://github.com/rubyide/vscode-ruby/pull/575

All 8 comments

Just ran into this as well. Seems config.reek is not picked up.

@tyler-king @guzart thanks for your feedback, I'll take a look.

Any news on this? It's still there...

+1 :)

Update:
Created a PR #287 that resolves the exclude_paths part of this. After some additional testing, if the .reek config file is passed to the reek CLI then it will behave properly. However, in quickly modifying the the reek.js linter script to also include the reek config in the passed arguments, it does not work. Inspecting the spawned command from linter.js I can't quite figure out why this doesn't work as the arguments are being passed to the command.

Some additional info:
The .reek config is being used, but specifically the directory configurations are not working.

This works

IrresponsibleModule:
  enabled: false

These examples do not

exclude_paths:
  - core/db/migrate

"app/controllers":
  IrresponsibleModule:
    enabled: false

Running reek from the VSCode terminal in the workspace root does what it is supposed to and all the examples above in the .reek file work as expected.

Closing for issue cleanup. Apologies if this is still an issue. We are working to improve the core extension experience.

The following command works as expected:
/my_project_root $ reek app/controllers

The following command doesn't pickup the directory directives:
/my_project_root/app $ reek controllers

Can confirm. I guess the trick would be to run reek from root with the relative file path as argument. Should this issue be reopened?

Hey @johanbaaij, here鈥檚 the PR related to this issue https://github.com/rubyide/vscode-ruby/pull/575

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rachsmithcodes picture rachsmithcodes  路  5Comments

wingrunr21 picture wingrunr21  路  4Comments

archfish picture archfish  路  5Comments

SerkanOruc picture SerkanOruc  路  5Comments

ckruse picture ckruse  路  5Comments