rubocop / rubocop-md

RuboCop for Markdown code snippets
MIT License
73 stars 14 forks source link

#<--rubocop/md--> prepended to every line #14

Closed pboling closed 2 years ago

pboling commented 2 years ago

I get this very often, in many of my projects. I just accidentally committed some of it, so now I have an example SHA where it happens. The Gemfile.lock that was used targets rubocop-md version 1.0.1, but I've seen this issue for years now, probably on many different versions. It seems intermittent, perhaps based on the presence of other factors in my environment.

palkan commented 2 years ago

Thanks for reporting.

I found that it's broken since RuboCop 1.30.0 (at least, our tests starting to fail since that version). So, you can try downgrading RuboCop to 1.29.0 for now.

palkan commented 2 years ago

Fixed in master. Please, give it a try and confirm that the problem disappeared (or not).

pboling commented 2 years ago

@palkan The primary problem is fixed, however, there is another less dramatic problem, though still concerning.

Offenses:

README.md:112:65: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
#<--rubocop/md-->#   2. snake - replaces spaces with underscores 
                                                                ^
README.md:132:26: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
#<--rubocop/md-->formats: 

The unwanted #<--rubocop/md--> is in the warning/error output. It doesn't get added to the file in the end, but no other RuboCop gems do this, so I think there must be some outdated code here.

At least I can start using the gem again!