New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--ignore-parent-exclusion does not work if --parallel is used #7790
Comments
That's by design. If RuboCop, when run from a subdirectory, would inspect files that are excluded when running from the project root, that would be kind of a gotcha. I'm not sure about the exact scenarios when this becomes an issue, but the behavior is not an accident. |
…options [Fix #7790] Set options in ConfigLoader earlier
This fixes another problem that's similar to the one reported in rubocop#7790. The problem is still that configuration is read and cached when we validate options vs configuration. By acting on all options first, we make sure that the first time we read configuration, it's done according to the given options. Specifically, it's the --force-default-config option that's now being respected.
This fixes another problem that's similar to the one reported in #7790. The problem is still that configuration is read and cached when we validate options vs configuration. By acting on all options first, we make sure that the first time we read configuration, it's done according to the given options. Specifically, it's the --force-default-config option that's now being respected.
The switch
--ignore-parent-exclusion
seems to be ignored if--parallel
is also present.Expected behavior
The following commands should always inspect the same number of files:
Actual behavior
Adding
--parallel
seems to disable the effect of--ignore-parent-exclusion
.Steps to reproduce the problem
Content of
.rubocop.yml
:Content of
subdir/.rubocop.yml
:This is the output of running Rubocop with different switches, from inside the
subdir
directory:rubocop
: "0 file inspected"rubocop --parallel
: "0 file inspected"rubocop --ignore-parent-exclusion
: "1 file inspected"rubocop --ignore-parent-exclusion --parallel
: "0 files inspected"NOTE: to be fair, I'm not even sure why I need to use the
--ignore-parent-exclusion
flag, as I'm not specifyinginherit
in the config file insidesubdir
, so I would expect Rubocop to use that file and ignore the config file in the parent directory.RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: