Fix Rubocop warnings for generation code