Skip to content

Commit

Permalink
Autofix other offenses
Browse files Browse the repository at this point in the history
- Performance/DeleteSuffix (unsafe)
- Performance/StringReplacement
- Performance/UnfreezeString (unsafe)
  • Loading branch information
tagliala committed Feb 27, 2024
1 parent 60513ae commit 2cebb66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/haml_lint/linter.rb
Expand Up @@ -37,7 +37,7 @@ def run(document, autocorrect: nil) # rubocop:disable Metrics
:error
)
rescue StandardError => e
msg = "Couldn't process the file".dup
msg = +"Couldn't process the file"
if @autocorrect
# Those lints related to auto-correction were not saved, so don't display them
@lints = []
Expand Down Expand Up @@ -231,7 +231,7 @@ def tag_with_inline_text(tag_node)
# excess whitespace
@document.source_lines[(tag_node.line - 1)...(following_node_line(tag_node) - 1)]
.map do |line|
line.strip.gsub(/\|\z/, '').rstrip
line.strip.delete_suffix('|').rstrip
end.join(' ')
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_lint/ruby_extraction/chunk_extractor.rb
Expand Up @@ -546,7 +546,7 @@ def extract_raw_ruby_lines(haml_processed_ruby_code, first_line_index)
joined_lines = lines.join("\n")

if haml_processed_ruby_code.include?("\n")
haml_processed_ruby_code = haml_processed_ruby_code.gsub("\n", ' ')
haml_processed_ruby_code = haml_processed_ruby_code.tr("\n", ' ')
end

haml_processed_ruby_code.split(/[, ]/)
Expand Down

0 comments on commit 2cebb66

Please sign in to comment.