Skip to content

Commit

Permalink
style: Fix RuboCop offence
Browse files Browse the repository at this point in the history
```
lib/git_stats/git_data/comment_stat.rb:28:74: C: [Corrected] Style/RedundantStringEscape: Redundant escape of - inside string literal.
                  "{if ($0 ~ /^\\+#{escaped_string}/) adds++; if ($0 ~ /^\-#{escaped_string}/) dels++} " \
                                                                         ^^
```
  • Loading branch information
mishina2228 committed Oct 27, 2022
1 parent eeb1116 commit 73ae3ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/git_stats/git_data/comment_stat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def calculate_stat
escaped_string = escape_characters_in_string(commit.repo.comment_string)
command = "git show #{commit.sha} | " \
"awk 'BEGIN {adds=0; dels=0} " \
"{if ($0 ~ /^\\+#{escaped_string}/) adds++; if ($0 ~ /^\-#{escaped_string}/) dels++} " \
"{if ($0 ~ /^\\+#{escaped_string}/) adds++; if ($0 ~ /^-#{escaped_string}/) dels++} " \
"END {print adds \" insertions \" dels \" deletes\"}'"
stat_line = commit.repo.run(command).lines.to_a[0]
if stat_line.blank?
Expand Down

0 comments on commit 73ae3ec

Please sign in to comment.