do not globally disable rubocop rules

This commit is contained in:
Klaus Zanders
2025-03-31 15:46:57 +02:00
parent 4a98bcaaff
commit 4ff9d35a2f
+3 -7
View File
@@ -28,8 +28,6 @@
# Changes to this file should be kept in sync with
# frontend/src/app/shared/helpers/chronic_duration.js.
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/PerceivedComplexity
module ChronicDuration
extend self
@@ -81,7 +79,7 @@ module ChronicDuration
# Given an integer and an optional format,
# returns a formatted string representing elapsed time
# rubocop:disable Lint/UselessAssignment
def output(seconds, opts = {})
def output(seconds, opts = {}) # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
int = seconds.to_i
seconds = int if seconds - int == 0 # if seconds end with .0
@@ -286,7 +284,7 @@ module ChronicDuration
end
# Parse 3:41:59 and return 3 hours 41 minutes 59 seconds
def filter_by_type(string)
def filter_by_type(string) # rubocop:disable Metrics/AbcSize
chrono_units_list = duration_units_list.reject { |v| v == "weeks" }
if string.delete(" ")&.match?(time_matcher)
@@ -313,7 +311,7 @@ module ChronicDuration
# Get rid of unknown words and map found
# words to defined time units
def filter_through_white_list(string, opts)
def filter_through_white_list(string, opts) # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
res = []
string.split.each do |word|
if word&.match?(float_matcher)
@@ -374,5 +372,3 @@ module ChronicDuration
%w[and with plus]
end
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/PerceivedComplexity