Skip to content

Commit

Permalink
Autofix all offenses in non-production code
Browse files Browse the repository at this point in the history
Disable false Performance/Detect positives because `tree` is not
reversable
  • Loading branch information
tagliala committed Feb 27, 2024
1 parent 263dad3 commit 60513ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/haml_lint/tree/haml_comment_node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'-# haml-lint:enable LineLength'
]
end
let(:node) { document.tree.select { |node| node.type == :haml_comment }.last }
let(:node) { document.tree.select { |node| node.type == :haml_comment }.last } # rubocop:disable Performance/Detect

let(:expectation) do
[
Expand All @@ -63,7 +63,7 @@
'-# haml-lint:enable LineLength'
]
end
let(:node) { document.tree.select { |node| node.type == :haml_comment }.last }
let(:node) { document.tree.select { |node| node.type == :haml_comment }.last } # rubocop:disable Performance/Detect

let(:out_of_scope) do
HamlLint::Directive.new(lines[2], 3, 'disable', %w[AlignmentTabs])
Expand Down
4 changes: 2 additions & 2 deletions spec/support/examples_parsing_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def examples_from(path) # rubocop:disable Metrics
example_string = example_string.gsub(/\s*!#.*/, '')

if example_string.include?('^')
silent_example_string = example_string.gsub('^^', '').gsub('^', '-').gsub('%%', '')
silent_example_string = example_string.gsub('^^', '').tr('^', '-').gsub('%%', '')
out_example_string = example_string.gsub('^^', 'HL.out = ')
.gsub('%%', ' ')
.gsub('^', '=')
.tr('^', '=')
[
Example.new("(^ as -)#{title}", silent_example_string, path, cur_line_number),
Example.new("(^ as =)#{title}", out_example_string, path, cur_line_number),
Expand Down

0 comments on commit 60513ae

Please sign in to comment.