We can autocorrect using only some cops by passing --only CopType/CopName
.
rubocop --only Style/HashTransformKeys
First run with --safe-auto-correct
to see the affected changes:
rubocop --safe-auto-correct --only Style/HashTransformKeys,Style/HashTransformValues,Style/HashEachMethods
Then run it with --auto-correct
(-a
):
rubocop -a --only Style/HashTransformKeys,Style/HashTransformValues,Style/HashEachMethods