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 not sure if this is a known issue or not, but I didn't see anything in the docs about it.
We're working to add RuboCop to a mature codebase, and have developed a strategy that'll allow us to slowly introduce new cops. We essentially maintain two configs:
.rubocop.yml — Disables all cops by default, and just enables ones we've explicitly allowed after evaluating them, configuring as necessary, and fixing offenses.
.rubocop_wip.yml — The "typical" .rubocop.yml setup. Enables all default cops, and layers on our own configuration. Includes .rubocop_todo.yml.
The idea here is that we can run rubocop with .rubocop.yml and it'll run against cops we've evaluated/configured. That allows us to correct offenses for those cops on an ongoing basis.
For new code, after fixing those offenses, we'd like to run rubocop --config .rubocop_wip.yml --regenerate-todo to refresh the TODO file with all new offenses for cops we haven't evaluated yet (since the offenses for those which we have evaluated would have been fixed above).
However, that doesn't seem to work. It looks like rubocop ignores the --config flag and generates the .rubocop_todo.yml based off .rubocop.yml, so long as that file exists.
…ecified config file by option
Use `create_empty_file` instead of `create_file` with empty contents
Co-authored-by: Koichi ITO <koic.ito@gmail.com>
Update changelog/fix_autogenerateconfig_command_ignores_config.md
Co-authored-by: Koichi ITO <koic.ito@gmail.com>
I'm not sure if this is a known issue or not, but I didn't see anything in the docs about it.
We're working to add RuboCop to a mature codebase, and have developed a strategy that'll allow us to slowly introduce new cops. We essentially maintain two configs:
.rubocop.yml
— Disables all cops by default, and just enables ones we've explicitly allowed after evaluating them, configuring as necessary, and fixing offenses..rubocop_wip.yml
— The "typical".rubocop.yml
setup. Enables all default cops, and layers on our own configuration. Includes.rubocop_todo.yml
.The idea here is that we can run
rubocop
with.rubocop.yml
and it'll run against cops we've evaluated/configured. That allows us to correct offenses for those cops on an ongoing basis.For new code, after fixing those offenses, we'd like to run
rubocop --config .rubocop_wip.yml --regenerate-todo
to refresh the TODO file with all new offenses for cops we haven't evaluated yet (since the offenses for those which we have evaluated would have been fixed above).However, that doesn't seem to work. It looks like
rubocop
ignores the--config
flag and generates the.rubocop_todo.yml
based off.rubocop.yml
, so long as that file exists.Demo with reproduction steps: https://github.com/jimryan/rubocop-custom-config-regenerate-todo-demo
Expected behavior
Supplied config file is used to generate the TODO.
Actual behavior
rubocop uses
.rubocop.yml
despite being explicitly passed a config file via--config
Steps to reproduce the problem
https://github.com/jimryan/rubocop-custom-config-regenerate-todo-demo
RuboCop version
The text was updated successfully, but these errors were encountered: