lxxxvi / ruboclean

Ruby gem that puts `.rubocop.yml` into order.
MIT License
18 stars 4 forks source link

preserve comments #24

Closed lxxxvi closed 1 year ago

lxxxvi commented 1 year ago

As requested in #23, this PR introduces the --preserve-comments flag. It allows to preserve preceding comments in a configuration file. However, it does not preserve inline comments. Example:

--- 

Foo:
  - something # inline comment about Foo.something

# Comment about Bar
Bar:
  - else

ruboclean --preserve-comments

--- 

# Comment about Bar
Bar:
  - else

Foo:
  - something