lxxxvi / ruboclean

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

Check that `Include` and `Exclude` paths exist #33

Closed issyl0 closed 7 months ago

issyl0 commented 7 months ago

Hi there! Thanks for building this tool, I really like it! Feel free to take or leave this PR, but I thought it would be useful to add a feature to check that paths really exist.

This adds a PathCleanup class that removes any paths in the Include and Exclude lists that don't exist (relative to the .rubocop.yml, ignoring paths with globs).

This is useful for when you have a .rubocop.yml file that has been around for a while and has lots of paths that people forget to clean up when they delete the files, so doing so manually would be tedious.

lxxxvi commented 7 months ago

Hi @issyl0 👋

That's a cool feature, thank you very much for your contribution. Let me have a look at it today or tomorrow. Will get back to you soon.

issyl0 commented 7 months ago

Thanks for the review @lxxxvi - I've made the requested changes. I'm absolutely fine to add a --preserve-paths, but maybe in a separate PR since there's quite a bit going on here.

lxxxvi commented 7 months ago

@issyl0 Thanks a lot for your contribution. 🙌 It would be cool to see the --preserve-paths feature in a follow up!