mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
do not globally disable rubocop rules
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user