Open wjessop opened 2 days ago
How does RuboCop handle it? I think the right answer is probably to mirror them
Rubocop takes a list of files:
% rubocop -h
Usage: rubocop [options] [file1, file2, ...]
Basic Options:
…
It seems that Rubocop will take a directory too and run on all files contained within it and it's subdirectories:
% pwd
root/
% rubocop rails_apps/widgets_app
<robocop runs on all files in all subdirs of rails_apps/widgets_app>
However, it seems I've got Rubocop in my $PATH as it's not possible to bundle exec (the Gemfile is in rails_apps/widgets_app
and not in the root of the repo which means that bundle exec standardrb --fix
will not work there either:
% bundle exec rubocop rails_apps/widgets_app
Could not locate Gemfile or .bundle/ directory
The alternative would be to do something like reviewdog/action-rubocop and to allow specifying a workdir
in the action that we could either cd
to before running bundle exec …
, or pushd/popd
around to maintain the working directory.
Yeah, I'd shop around to look at a few other linter actions on github and see if there's a consensus name for this, but it sounds like a working directory config option is the best bet
A client has their Rails app contained in a subdirectory of a monorepo and not the root:
would an option to run standardrb in a subdirectory be possible?