cookpad / global-style-guides

Official style guides for Cookpad Global
67 stars 16 forks source link

Sort Rubocop directives in alphabetical order #193

Closed Bodacious closed 2 years ago

Bodacious commented 2 years ago

This PR sorts the Rubocop Ruby configuration directives in alphabetical order.

I haven't changed/added/removed any of the rules.

I hope this doesn't seem pedantic, but I find it easier to read the rules and make sure there are no dupes when they are kept in order.


Code used to sort this file:

require "yaml"

filepath = "./.rubocop.ruby.yml"
hash = YAML.safe_load_file(filepath)
sorted_hash = Hash[hash.sort]
File.write(filepath, sorted_hash.to_yaml)
Knack commented 2 years ago

What if we do the same with .rubocop.rails.yml? We could do it even manually; it's small 😄

Bodacious commented 2 years ago

What if we do the same with .rubocop.rails.yml? We could do it even manually; it's small 😄

I was waiting to see how this PR was received before doing that. But I think it's a good idea :)

Bodacious commented 2 years ago

@Knack PR for the Rails file #194 :)