From f63e3bcd662bb056956a13d3c3cd124fecacd5a8 Mon Sep 17 00:00:00 2001 From: Justin Hart Date: Mon, 11 Nov 2024 10:30:25 -0800 Subject: [PATCH] rollback style changes (squish me) --- .github/workflows/rubocop.yml | 3 - .github/workflows/ruby.yml | 10 +- .rubocop.yml | 15 +- .rubocop_todo.yml | 439 ---------------------------------- Gemfile | 21 +- Rakefile | 1 + exe/resque-scheduler | 1 + resque-scheduler.gemspec | 23 +- 8 files changed, 35 insertions(+), 478 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index ace1b08e..a6e6845c 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -19,9 +19,6 @@ jobs: fail-fast: false matrix: ruby-version: - # - "3.0" - # - "3.1" - # - "3.2" - "3.3" steps: diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index fc2a1a80..688f564e 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -35,13 +35,13 @@ jobs: - "3.2" - "3.3" resque-version: - # - "master" - - "~> 2.6" + - "master" + - "~> 2.4" - "~> 1.27" rufus-scheduler: - # - "~> 3.6.0" - # - "~> 3.7.0" - # - "~> 3.8.0" + - "~> 3.6.0" + - "~> 3.7.0" + - "~> 3.8.0" - "~> 3.9" redis-version: - "~> 3.3" diff --git a/.rubocop.yml b/.rubocop.yml index d01a218f..ec46ce2f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -inherit_from: .rubocop_todo.yml - AllCops: SuggestExtensions: false TargetRubyVersion: 3.0 @@ -10,14 +8,15 @@ AllCops: - resque-scheduler.gemspec - bin/resque-scheduler -require: - - rubocop-rake - -Style/DoubleNegation: - Enabled: false -Metrics/PerceivedComplexity: +Gemspec/DevelopmentDependencies: Enabled: false Metrics/ClassLength: Max: 110 +Metrics/PerceivedComplexity: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Style/DoubleNegation: + Enabled: false Style/FrozenStringLiteralComment: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index f0c47e5e..00000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,439 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2024-10-16 19:42:39 UTC using RuboCop version 1.67.0. -# 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: 17 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLineAfterGuardClause: - Exclude: - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/configuration.rb' - - 'lib/resque/scheduler/delaying_extensions.rb' - - 'lib/resque/scheduler/server.rb' - - 'lib/resque/scheduler/signal_handling.rb' - - 'test/multi_process_test.rb' - - 'test/scheduler_test.rb' - - 'test/test_helper.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowAliasSyntax, AllowedMethods. -# AllowedMethods: alias_method, public, protected, private -Layout/EmptyLinesAroundAttributeAccessor: - Exclude: - - 'lib/resque/scheduler/configuration.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLinesAroundExceptionHandlingKeywords: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. -# SupportedHashRocketStyles: key, separator, table -# SupportedColonStyles: key, separator, table -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/HashAlignment: - Exclude: - - 'test/resque-web_test.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/LineEndStringConcatenationIndentation: - Exclude: - - 'lib/resque/scheduler/logger_builder.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Lint/AmbiguousOperatorPrecedence: - Exclude: - - 'lib/resque/scheduler/lock/base.rb' - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/BooleanSymbol: - Exclude: - - 'lib/resque/scheduler/configuration.rb' - -# Offense count: 3 -# Configuration parameters: AllowedMethods. -# AllowedMethods: enums -Lint/ConstantDefinitionInBlock: - Exclude: - - 'test/resque-web_test.rb' - - 'test/scheduler_test.rb' - - 'test/util_test.rb' - -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/NonAtomicFileOperation: - Exclude: - - 'lib/resque/scheduler/env.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments. -Lint/UnusedBlockArgument: - Exclude: - - 'examples/dynamic-scheduling/lib/tasks/resque.rake' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, ContextCreatingMethods, MethodCreatingMethods. -Lint/UselessAccessModifier: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects. -Lint/Void: - Exclude: - - 'lib/resque/scheduler/lock/resilient.rb' - -# Offense count: 15 -# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. -Metrics/AbcSize: - Max: 43 - -# Offense count: 32 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. -# AllowedMethods: refine -Metrics/BlockLength: - Max: 934 - -# Offense count: 1 -# Configuration parameters: CountComments, Max, CountAsOne. -Metrics/ClassLength: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 4 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/CyclomaticComplexity: - Max: 12 - -# Offense count: 24 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. -Metrics/MethodLength: - Max: 34 - -# Offense count: 2 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ModuleLength: - Max: 373 - -# Offense count: 3 -# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. -# CheckDefinitionPathHierarchyRoots: lib, spec, test, src -# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS -Naming/FileName: - Exclude: - - 'Rakefile.rb' - - 'examples/config/initializers/resque-web.rb' - - 'lib/resque-scheduler.rb' - - 'test/resque-web_test.rb' - -# Offense count: 3 -# Configuration parameters: ForbiddenDelimiters. -# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) -Naming/HeredocDelimiterNaming: - Exclude: - - 'lib/resque/scheduler/cli.rb' - - 'lib/resque/scheduler/lock/resilient.rb' - -# Offense count: 2 -# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to -Naming/MethodParameterName: - Exclude: - - 'lib/resque/scheduler/failure_handler.rb' - - 'lib/resque/scheduler/server.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: PreferredName. -Naming/RescuedExceptionsVariableName: - Exclude: - - 'test/multi_process_test.rb' - -# Offense count: 2 -# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. -# SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 -Naming/VariableNumber: - Exclude: - - 'test/multi_process_test.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Rake/Desc: - Exclude: - - 'examples/dynamic-scheduling/lib/tasks/resque.rake' - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Security/JSONLoad: - Exclude: - - 'lib/resque/scheduler/server.rb' - -# Offense count: 1 -Security/MarshalLoad: - Exclude: - - 'test/multi_process_test.rb' - -# Offense count: 9 -# This cop supports unsafe autocorrection (--autocorrect-all). -Security/YAMLLoad: - Exclude: - - 'examples/config/initializers/resque-web.rb' - - 'test/scheduler_args_test.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: separated, grouped -Style/AccessorGrouping: - Exclude: - - 'lib/resque/scheduler/configuration.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowOnConstant, AllowOnSelfClass. -Style/CaseEquality: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. -# SupportedStyles: assign_to_condition, assign_inside_condition -Style/ConditionalAssignment: - Exclude: - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/delaying_extensions.rb' - -# Offense count: 21 -# Configuration parameters: AllowedConstants. -Style/Documentation: - Enabled: false - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/EachWithObject: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, EnforcedStyle. -# SupportedStyles: compact, expanded -Style/EmptyMethod: - Exclude: - - 'test/scheduler_test.rb' - - 'test/test_helper.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/ExpandPathArguments: - Exclude: - - 'examples/dynamic-scheduling/lib/tasks/resque.rake' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/ExplicitBlockArgument: - Exclude: - - 'lib/resque/scheduler/delaying_extensions.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedVars. -Style/FetchEnvVar: - Exclude: - - 'examples/config/initializers/resque-web.rb' - - 'lib/resque/scheduler/tasks.rb' - -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. -Style/GuardClause: - Exclude: - - 'examples/dynamic-scheduling/app/jobs/fix_schedules_job.rb' - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/lock/basic.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: braces, no_braces -Style/HashAsLastArrayItem: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedReceivers. -# AllowedReceivers: Thread.current -Style/HashEachMethods: - Exclude: - - 'lib/resque/scheduler.rb' - - 'test/resque-web_test.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowIfModifier. -Style/IfInsideElse: - Exclude: - - 'lib/resque/scheduler.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Style/IfUnlessModifier: - Exclude: - - '.simplecov' - - 'lib/resque/scheduler/scheduling_extensions.rb' - - 'lib/resque/scheduler/util.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/MultilineIfModifier: - Exclude: - - 'lib/resque/scheduler/configuration.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: keyword, braces -Style/MultilineMemoization: - Exclude: - - 'test/test_helper.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMethodComparison, ComparisonsThreshold. -Style/MultipleComparison: - Exclude: - - 'lib/resque/scheduler/server.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/NegatedIfElseCondition: - Exclude: - - 'lib/resque/scheduler/util.rb' - - 'test/scheduler_locking_test.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. -Style/NumericLiterals: - MinDigits: 6 - -# Offense count: 7 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/delaying_extensions.rb' - - 'lib/resque/scheduler/server.rb' - - 'test/scheduler_locking_test.rb' - -# Offense count: 1 -Style/OpenStructUse: - Exclude: - - 'test/scheduler_test.rb' - -# Offense count: 4 -# Configuration parameters: AllowedMethods. -# AllowedMethods: respond_to_missing? -Style/OptionalBooleanParameter: - Exclude: - - 'lib/resque/scheduler/lock/resilient.rb' - - 'lib/resque/scheduler/scheduling_extensions.rb' - -# Offense count: 30 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Exclude: - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/lock.rb' - - 'lib/resque/scheduler/signal_handling.rb' - - 'lib/resque/scheduler/tasks.rb' - - 'test/cli_test.rb' - - 'test/configuration_test.rb' - - 'test/resque-web_test.rb' - - 'test/scheduler_test.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantBegin: - Exclude: - - 'lib/resque/scheduler.rb' - - 'test/delayed_queue_test.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantLineContinuation: - Exclude: - - 'lib/resque/scheduler/configuration.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantParentheses: - Exclude: - - 'lib/resque/scheduler/delaying_extensions.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantStringEscape: - Exclude: - - 'lib/resque/scheduler/locking.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, explicit -Style/RescueStandardError: - Exclude: - - 'lib/resque/scheduler.rb' - - 'lib/resque/scheduler/lock/base.rb' - - 'lib/resque/scheduler/server.rb' - -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. -# AllowedMethods: present?, blank?, presence, try, try! -Style/SafeNavigation: - Exclude: - - 'lib/resque/scheduler/delaying_extensions.rb' - - 'lib/resque/scheduler/signal_handling.rb' - -# Offense count: 5 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Mode. -Style/StringConcatenation: - Exclude: - - 'lib/resque/scheduler/logger_builder.rb' - - 'lib/resque/scheduler/server.rb' - - 'tasks/resque_scheduler.rake' - - 'test/scheduler_setup_test.rb' - - 'test/test_helper.rb' - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only -Style/YodaCondition: - Exclude: - - 'lib/resque/scheduler/delaying_extensions.rb' diff --git a/Gemfile b/Gemfile index 8e980e49..38ce455a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# vim:fileencoding=utf-8 source 'https://rubygems.org' case resque_version = ENV.fetch('RESQUE', 'latest') @@ -30,23 +31,3 @@ end gem 'sinatra', '> 2.0' gemspec - -gem 'bundler' -gem 'json' -gem 'minitest' -gem 'mocha' -gem 'pry' -gem 'rack-test' -gem 'rake' -gem 'simplecov' -gem 'test-unit' -gem 'timecop' -gem 'yard' - -# We pin rubocop because new cops have a tendency to result in false-y -# positives for new contributors, which is not a nice experience. -gem 'ostruct' -gem 'racc' -gem 'rubocop', '~> 1.4' -gem 'rubocop-minitest' -gem 'rubocop-rake' diff --git a/Rakefile b/Rakefile index cd3a078b..763604e0 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +# vim:fileencoding=utf-8 require 'bundler/gem_tasks' require 'rake/testtask' require 'yard' diff --git a/exe/resque-scheduler b/exe/resque-scheduler index 2c34d5e8..f26121d1 100755 --- a/exe/resque-scheduler +++ b/exe/resque-scheduler @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# vim:fileencoding=utf-8 require 'resque-scheduler' Resque::Scheduler::Cli.run! diff --git a/resque-scheduler.gemspec b/resque-scheduler.gemspec index e9e7b1cc..68940889 100644 --- a/resque-scheduler.gemspec +++ b/resque-scheduler.gemspec @@ -1,3 +1,4 @@ +# vim:fileencoding=utf-8 lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'resque/scheduler/version' @@ -5,14 +6,14 @@ require 'resque/scheduler/version' Gem::Specification.new do |spec| spec.name = 'resque-scheduler' spec.version = Resque::Scheduler::VERSION - spec.authors = <<-AUTHORS.split("\n").map(&:strip) + spec.authors = <<-EOF.split("\n").map(&:strip) Ben VandenBos Simon Eskildsen Ryan Biesemeyer Dan Buch Michael Bianco Patrick Tulskie - AUTHORS + EOF spec.email = %w[ bvandenbos@gmail.com sirup@sirupsen.com @@ -31,7 +32,7 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.metadata['rubygems_mfa_required'] = 'true' - spec.required_ruby_version = '>= 3.0.0' + spec.required_ruby_version = '>= 3.0' spec.files = `git ls-files -z`.split("\0").reject do |f| f.match(%r{^(test|spec|features|examples|bin|tasks)/}) || @@ -42,6 +43,22 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = %w[lib] + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'json' + spec.add_development_dependency 'minitest' + spec.add_development_dependency 'mocha' + spec.add_development_dependency 'ostruct' + spec.add_development_dependency 'pry' + spec.add_development_dependency 'racc' + spec.add_development_dependency 'rack-test' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'test-unit' + spec.add_development_dependency 'timecop' + spec.add_development_dependency 'yard' + + spec.add_development_dependency 'rubocop', '~> 1.4' + spec.add_dependency 'mono_logger', '~> 1.0' spec.add_dependency 'redis', '>= 3.3' spec.add_dependency 'resque', '>= 1.27'