rubocop / rubocop-md

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

Fix a RuboCop offense #5

Closed koic closed 5 years ago

koic commented 5 years ago

This PR fixes the following offense.

% bundle exec rake
Running RuboCop...
Inspecting 8 files
.....C..

Offenses:

lib/rubocop/markdown/preprocess.rb:13:19: C: Style/MutableConstant:
Freeze mutable objects assigned to constants.
      MD_REGEXP = /^([ \t]*`{3,4})([\w[[:blank:]]]*\n)([\s\S]+?)(^[\t]*\1[[:blank:]]*\n?)/m
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

8 files inspected, 1 offense detected
RuboCop failed!

Refer: https://github.com/rubocop-hq/rubocop/issues/6331

palkan commented 5 years ago

Thanks!