Skip to content

Commit

Permalink
Add comments to consecutive gsub calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning committed Feb 9, 2025
1 parent e461bad commit e79ec49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rubocop/rspec/config_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def initialize(config, descriptions)

def dump
YAML.dump(unified_config)
.gsub(%r{^\w+/}, "\n\\0")
.gsub(/^(\s+)- /, '\1 - ')
.gsub('"~"', '~')
.gsub(%r{^\w+/}, "\n\\0") # Add an extra newline before each cop.
.gsub(/^(\s+)- /, '\1 - ') # Add 2 spaces before each array element.
.gsub('"~"', '~') # Don't quote tilde, YAML's null value.
end

private
Expand Down

0 comments on commit e79ec49

Please sign in to comment.