Skip to content

Commit

Permalink
Fix new RuboCop lints
Browse files Browse the repository at this point in the history
  • Loading branch information
amake committed Mar 28, 2024
1 parent c2eee06 commit dcc794b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
18 changes: 9 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-02-25 04:43:35 UTC using RuboCop version 1.10.0.
# on 2024-03-28 22:53:01 UTC using RuboCop version 1.62.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 5
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
# Offense count: 7
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 24

# Offense count: 6
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 269

# Offense count: 2
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 9
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 26
Max: 28

# Offense count: 1
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 10
2 changes: 1 addition & 1 deletion lib/srx/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def segment(str, language:)
plain_text, markups = @format.extract_markups(str)

pos = 0
breaks_by_pos(plain_text, rules).each do |break_pos, _|
breaks_by_pos(plain_text, rules).each do |(break_pos, _)|
results << build_segment!(plain_text, markups, pos, break_pos)
pos = break_pos
end
Expand Down
2 changes: 0 additions & 2 deletions test/srx/engine_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_rule_names
assert_equal(%w[Default], engine.send(:rule_names, nil))
end

# rubocop:disable Style/RedundantRegexpEscape
def test_rules
engine = sample_engine
assert_equal(
Expand Down Expand Up @@ -48,7 +47,6 @@ def test_rules
engine.send(:rules, 'zh').map(&:after_break)
)
end
# rubocop:enable Style/RedundantRegexpEscape

def test_segment
engine = sample_engine
Expand Down

0 comments on commit dcc794b

Please sign in to comment.