Skip to content

Commit f32f0b5

Browse files
committed
rubocop auto correct for regex freezing
1 parent 31eed31 commit f32f0b5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/simplecov/lines_classifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class LinesClassifier
88
RELEVANT = 0
99
NOT_RELEVANT = nil
1010

11-
WHITESPACE_LINE = /^\s*$/.freeze
12-
COMMENT_LINE = /^\s*#/.freeze
11+
WHITESPACE_LINE = /^\s*$/
12+
COMMENT_LINE = /^\s*#/
1313
WHITESPACE_OR_COMMENT_LINE = Regexp.union(WHITESPACE_LINE, COMMENT_LINE)
1414

1515
def self.no_cov_line

lib/simplecov/source_file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def load_source
190190
end
191191
end
192192

193-
SHEBANG_REGEX = /\A#!/.freeze
193+
SHEBANG_REGEX = /\A#!/
194194
def shebang?(line)
195195
SHEBANG_REGEX.match?(line)
196196
end
@@ -202,7 +202,7 @@ def read_lines(file, lines, current_line)
202202
lines.concat([current_line], ensure_remove_undefs(file.readlines))
203203
end
204204

205-
RUBY_FILE_ENCODING_MAGIC_COMMENT_REGEX = /\A#\s*(?:-\*-)?\s*(?:en)?coding:\s*(\S+)\s*(?:-\*-)?\s*\z/.freeze
205+
RUBY_FILE_ENCODING_MAGIC_COMMENT_REGEX = /\A#\s*(?:-\*-)?\s*(?:en)?coding:\s*(\S+)\s*(?:-\*-)?\s*\z/
206206
def set_encoding_based_on_magic_comment(file, line)
207207
# Check for encoding magic comment
208208
# Encoding magic comment must be placed at first line except for shebang

lib/simplecov/useless_results_remover.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def self.call(coverage_result)
1212
end
1313

1414
def self.root_regx
15-
@root_regx ||= /\A#{Regexp.escape(SimpleCov.root + File::SEPARATOR)}/i.freeze
15+
@root_regx ||= /\A#{Regexp.escape(SimpleCov.root + File::SEPARATOR)}/i
1616
end
1717
end
1818
end

0 commit comments

Comments
 (0)