You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm ignoring rubocop violations in CI by only including the rubocop todo file when an environment variable is set.
I'm still interested in these failures locally, but don't want them to cause the jobs to fail.
When I recreate the todo file it shifts the include out of the conditional, which changes the meaning.
Expected behavior
It should leave the existing file alone.
Actual behavior
The file gets modified to the following:
inherit_from: .rubocop_todo.yml
<% if ENV["CI"] %>
<% end %>
Steps to reproduce the problem
Have the following at the top in your .rubocop.yml and run rubocop --auto-gen-config
<% if ENV["CI"] %>
inherit_from: .rubocop_todo.yml
<% end %>
The problem with the existing algorithm, for generating the inherit_from line
in --auto-gen-config runs, was that we started by removing the inherit_from
(if present) and then inserted it later.
The things we must deal with in the algorithm are
* there could be a pre-existing inherit_from in .rubocop.yml, or not
* there could be a YAML doc start ---, or not
* there could be inheritance from one or multiple files
A more robust approach to the removing, generating, and re-inserting is to
assume that any pre-existing inherit_from directive is already in the right
place. By replacing it with a placeholder and later replacing the placeholder
with the new inheritance directive, we will get it right without much effort.
I'm ignoring rubocop violations in CI by only including the rubocop todo file when an environment variable is set.
I'm still interested in these failures locally, but don't want them to cause the jobs to fail.
When I recreate the todo file it shifts the include out of the conditional, which changes the meaning.
Expected behavior
It should leave the existing file alone.
Actual behavior
The file gets modified to the following:
Steps to reproduce the problem
Have the following at the top in your
.rubocop.yml
and runrubocop --auto-gen-config
RuboCop version
The text was updated successfully, but these errors were encountered: