codeclimate / codeclimate-rubocop

Code Climate Engine for Rubocop
MIT License
59 stars 43 forks source link

Fix docs:scrape regex to skip forward to class definition #201

Closed natesholland closed 4 years ago

natesholland commented 5 years ago

This is a bug that I originally found in #168 but we decided to pull out into its own PR since it is a separate thing than upgrading rubocop.

This scraper was missing the documentation on files like lib/rubocop/cop/style/conditional_assignment.rb and lib/rubocop/cop/layout/indent_first_argument.rb Because they had a comment before the main docs comment. This was causing them to be rejected because the docs were not long enough, despite the fact that these files do in fact have docs.

A solution I am proposing for this problem is to use a look ahead to grab the comments that come immediately before the class definition as this is where the docs comments always are.

Please let me know if this should go into a different branch, or if I should make PRs into multiple branches for this.

filipesperandio commented 4 years ago

Closing for inactivity.

@natesholland If you wanna push this further, please re-open against the latest available channel, as of now channel/rubocop-0-76, and please, split the commits into what is a manual change and an automated one.

Thanks.