Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

do not globally disable rubocop rules

Klaus Zanders4ff9d35a2f69
diff --git a/lib/chronic_duration.rb b/lib/chronic_duration.rb
index 5e97dc49de6..f3a03d6ef8a 100644
--- a/lib/chronic_duration.rb
+++ b/lib/chronic_duration.rb
@@ -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