Skip to content

Commit

Permalink
Add YARD warnings to lint script; fix YARD warnings (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Aug 7, 2023
1 parent dab0a12 commit e062cee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/models/good_job/base_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class BaseExecution < BaseRecord
self.table_name = 'good_jobs'

# With a given class name
# @!method job_class
# @!method job_class(name)
# @!scope class
# @param string [String] Execution class name
# @param name [String] Execution class name
# @return [ActiveRecord::Relation]
scope :job_class, ->(name) { where(params_job_class.eq(name)) }

Expand Down
1 change: 0 additions & 1 deletion app/models/good_job/batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class Batch
)

# Create a new batch and enqueue it
# @param on_finish [String, Object] The class name of the callback job to be enqueued after the batch is finished
# @param properties [Hash] Additional properties to be stored on the batch
# @param block [Proc] Enqueue jobs within the block to add them to the batch
# @return [GoodJob::BatchRecord]
Expand Down
9 changes: 3 additions & 6 deletions app/models/good_job/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def self.queue_parser(string)
}, if: -> { @_destroy_job }

# Get executions with given ActiveJob ID
# @!method active_job_id
# @!method active_job_id(active_job_id)
# @!scope class
# @param active_job_id [String]
# ActiveJob ID
Expand Down Expand Up @@ -115,7 +115,7 @@ def self.queue_parser(string)
scope :creation_ordered, -> { order(created_at: :asc) }

# Order executions for de-queueing
# @!method dequeueing_ordered
# @!method dequeueing_ordered(parsed_queues)
# @!scope class
# @param parsed_queues [Hash]
# optional output of .queue_parser, parsed queues, will be used for
Expand All @@ -130,7 +130,7 @@ def self.queue_parser(string)
end)

# Order executions in order of queues in array param
# @!method queue_ordered
# @!method queue_ordered(queues)
# @!scope class
# @param queues [Array<string] ordered names of queues
# @return [ActiveRecord::Relation]
Expand Down Expand Up @@ -300,9 +300,6 @@ def self.next_scheduled_at(after: nil, limit: 100, now_limit: nil)
# Epoch timestamp when the job should be executed, if blank will delegate to the ActiveJob instance
# @param create_with_advisory_lock [Boolean]
# Whether to establish a lock on the {Execution} record after it is created.
# @param persist_immediately [Boolean]
# Whether to save the record immediately or just initialize it with values. When bulk-inserting
# jobs the caller takes care of the persistence and sets this parameter to `false`
# @return [Execution]
# The new {Execution} instance representing the queued ActiveJob job.
def self.enqueue(active_job, scheduled_at: nil, create_with_advisory_lock: false)
Expand Down
3 changes: 3 additions & 0 deletions bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ FileUtils.chdir GEM_ROOT do

system! "bundle exec rubocop #{flags.join(' ')}"

puts "\n== YARD =="
system! "bundle exec yard stats --no-cache --fail-on-warning"

puts "\n== ERB Lint =="
if options[:nofix]
system!("bundle exec erblint app/views")
Expand Down
2 changes: 1 addition & 1 deletion lib/good_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def self._on_thread_error(exception)

# Custom Active Record configuration that is class_eval'ed into +GoodJob::BaseRecord+
# @param block Custom Active Record configuration
# @retyrn [void]
# @return [void]
#
# @example
# GoodJob.configure_active_record do
Expand Down
2 changes: 1 addition & 1 deletion lib/good_job/sd_notify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def self.fdstore(unset_env=false)
notify(FDSTORE, unset_env)
end

# @param [Boolean] true if the service manager expects watchdog keep-alive
# @return [Boolean] true if the service manager expects watchdog keep-alive
# notification messages to be sent from this process.
#
# If the $WATCHDOG_USEC environment variable is set,
Expand Down

0 comments on commit e062cee

Please sign in to comment.