Repository navigation
Add Stdin-filename arg to Reek linter - #575
Conversation
Passes an `--stdin-filename` argument to Reek when linting files. This gives Reek context about the piped contents and supports using the [`directories` configuration](https://github.com/troessner/reek#working-with-rails). Caveat: Because this change sends the absolute path to the file, the configuration in directories must be prefixed with `**` for it to work. e.g. ```yml directories: '**/app/controllers': IrresponsibleModule: enabled: false ```
|
When this PR will be merged??? |
Because of this change and before I add the ** the linter from the extension will show smells that won't show when I run: bundle exec reek folder/file.rbIf I prefix directories with ** as suggested, the smells don't show on vscode-ruby, but show up when I run reek on it's own, or through CodeClimate. Possible SolutionFor future readers, configuring the directory directive as shown, seems to work with both the reek command line tool and vscode-ruby: directories:
"folder|**/folder":
UtilityFunction:
enabled: falseIt's not ideal to have to repeat the folder name twice, but at least this allows both tools to use the same configuration. My own caveat: the documentation and and the tests say a |
Passes an
--stdin-filenameargument to Reek when linting files.This gives Reek context about the piped contents and supports using the
directoriesconfiguration.Caveat:
Because this change sends the absolute path to the file, the configuration in directories must be prefixed with
**for it to work. e.g.