Open arielj opened 3 years ago
Reek configuration allows us to configure reek depending on the files' directory. They suggest for example this config for projects using Rails https://github.com/troessner/reek#working-with-rails
directories: "app/controllers": IrresponsibleModule: enabled: false NestedIterators: max_allowed_nesting: 2 UnusedPrivateMethod: enabled: false InstanceVariableAssumption: enabled: false
This is not working because the linter is changing the working directory for the reek command to the current file's directory instead of the root of the project here https://github.com/AtomLinter/linter-reek/blob/master/lib/linter-reek.js#L116
const execOpts = { cwd: path.dirname(filePath), ignoreExitCode: true, };
Changing that to:
const execOpts = { cwd: atom.project.getPaths()[0], ignoreExitCode: true, };
fixes the issue (setting the working directory as the root of the project.
I can create a PR, but I'm not sure if that there's for a specific reason.
Reek configuration allows us to configure reek depending on the files' directory. They suggest for example this config for projects using Rails https://github.com/troessner/reek#working-with-rails
This is not working because the linter is changing the working directory for the reek command to the current file's directory instead of the root of the project here https://github.com/AtomLinter/linter-reek/blob/master/lib/linter-reek.js#L116
Changing that to:
fixes the issue (setting the working directory as the root of the project.
I can create a PR, but I'm not sure if that there's for a specific reason.