Skip to content

Commit

Permalink
Unify frozen_string_literal comment style (#1003)
Browse files Browse the repository at this point in the history
* Unify `frozen_string_litteral` comment syle

Some file used

```ruby
class ...
```

other used
```ruby

class ...
```

This commit makes the style same in every file,
I've opeted to same style that Rails uses, and majority of other
projects.

* Enable rubocop rule

---------

Co-authored-by: Ben Sheldon [he/him] <[email protected]>
  • Loading branch information
dixpac and bensheldon authored Jul 10, 2023
1 parent 06150f9 commit e6be97f
Show file tree
Hide file tree
Showing 131 changed files with 131 additions and 1 deletion.
1 change: 1 addition & 0 deletions .mdstyle.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
all
rule 'MD007', indent: 4 # Unordered list indentation
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gemspec/DevelopmentDependencies:
Enabled: false

Layout/EmptyLineAfterMagicComment:
Enabled: false
Enabled: true

Layout/HashAlignment:
Enabled: false
Expand Down
1 change: 1 addition & 0 deletions .yard_support.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'kramdown'
require 'kramdown-parser-gfm'

Expand Down
1 change: 1 addition & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

ruby_27_or_higher = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7')
ruby_31_or_higher = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1')
jruby = RUBY_PLATFORM.include?('java')
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

begin
require 'bundler/setup'
rescue LoadError
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/batches_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class BatchesController < GoodJob::ApplicationController
def index
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/cron_entries_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class CronEntriesController < GoodJob::ApplicationController
before_action :check_settings_migration!, only: [:enable, :disable]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/frontends_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class FrontendsController < ActionController::Base # rubocop:disable Rails/ApplicationController
skip_after_action :verify_same_origin_request, raise: false
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/jobs_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class JobsController < GoodJob::ApplicationController
DISCARD_MESSAGE = "Discarded through dashboard"
Expand Down
1 change: 1 addition & 0 deletions app/controllers/good_job/processes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class ProcessesController < GoodJob::ApplicationController
def index
Expand Down
1 change: 1 addition & 0 deletions app/filters/good_job/base_filter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class BaseFilter
DEFAULT_LIMIT = 25
Expand Down
1 change: 1 addition & 0 deletions app/filters/good_job/batches_filter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class BatchesFilter < BaseFilter
def records
Expand Down
1 change: 1 addition & 0 deletions app/filters/good_job/jobs_filter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
class JobsFilter < BaseFilter
def states
Expand Down
1 change: 1 addition & 0 deletions app/helpers/good_job/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module ApplicationHelper
def format_duration(sec)
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/good_job/error_events.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Shared methods for filtering Execution/Job records from the +good_jobs+ table.
module ErrorEvents
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/good_job/filterable.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Shared methods for filtering Execution/Job records from the +good_jobs+ table.
module Filterable
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/good_job/reportable.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module Reportable
# There are 3 buckets of non-overlapping statuses:
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/base_record.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
ACTIVE_RECORD_PARENT_CLASS = Object.const_get(GoodJob.active_record_parent_class)

Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/cron_entry.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "concurrent/hash"
require "concurrent/scheduled_task"
require "fugit"
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/execution.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# ActiveRecord model that represents an +ActiveJob+ job.
class Execution < BaseExecution
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/execution_result.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Stores the results of job execution
class ExecutionResult
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/job.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# ActiveRecord model that represents an +ActiveJob+ job.
# There is not a table in the database whose discrete rows represents "Jobs".
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/lockable.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
#
# Adds Postgres advisory locking capabilities to an ActiveRecord record.
Expand Down
1 change: 1 addition & 0 deletions app/models/good_job/process.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'socket'

module GoodJob # :nodoc:
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

GoodJob::Engine.routes.draw do
root to: redirect(path: 'jobs')

Expand Down
1 change: 1 addition & 0 deletions exe/good_job
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'good_job/cli'

GoodJob::CLI.within_exe = true
Expand Down
1 change: 1 addition & 0 deletions good_job.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require_paths = ["lib"]
require_paths.each do |require_path|
$LOAD_PATH.push File.expand_path(require_path, __dir__)
Expand Down
1 change: 1 addition & 0 deletions lib/active_job/queue_adapters/good_job_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module ActiveJob # :nodoc:
module QueueAdapters # :nodoc:
# See {GoodJob::Adapter} for details.
Expand Down
1 change: 1 addition & 0 deletions lib/generators/good_job/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails/generators'
require 'rails/generators/active_record'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobs < ActiveRecord::Migration<%= migration_version %>
def change
# Uncomment for Postgres v12 or earlier to enable gen_random_uuid() support
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobs < ActiveRecord::Migration<%= migration_version %>
def change
# Uncomment for Postgres v12 or earlier to enable gen_random_uuid() support
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobSettings < ActiveRecord::Migration<%= migration_version %>
def change
reversible do |dir|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateIndexGoodJobsJobsOnPriorityCreatedAtWhenUnfinished < ActiveRecord::Migration<%= migration_version %>
disable_ddl_transaction!

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobBatches < ActiveRecord::Migration<%= migration_version %>
def change
reversible do |dir|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobExecutions < ActiveRecord::Migration<%= migration_version %>
def change
reversible do |dir|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class CreateGoodJobsErrorEvent < ActiveRecord::Migration<%= migration_version %>
def change
reversible do |dir|
Expand Down
1 change: 1 addition & 0 deletions lib/generators/good_job/update_generator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails/generators'
require 'rails/generators/active_record'

Expand Down
1 change: 1 addition & 0 deletions lib/good_job.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "active_job"
require "active_job/queue_adapters"

Expand Down
1 change: 1 addition & 0 deletions lib/good_job/active_job_extensions/batches.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module ActiveJobExtensions
module Batches
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/active_job_extensions/concurrency.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module ActiveJobExtensions
module Concurrency
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/active_job_extensions/interrupt_errors.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module ActiveJobExtensions
module InterruptErrors
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/active_job_extensions/notify_options.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
module ActiveJobExtensions
# Allows configuring whether GoodJob should emit a NOTIFY event when a job is enqueued.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/adapter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
#
# ActiveJob Adapter.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/assignable_connection.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob # :nodoc:
# Extends an ActiveRecord odel to override the connection and use
# an explicit connection that has been removed from the pool.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/bulk.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/module/attribute_accessors_per_thread'

module GoodJob
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/capsule.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# A GoodJob::Capsule contains the resources necessary to execute jobs, including
# a {GoodJob::Scheduler}, {GoodJob::Poller}, {GoodJob::Notifier}, and {GoodJob::CronManager}.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/cleanup_tracker.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob # :nodoc:
# Tracks thresholds for cleaning up old jobs.
class CleanupTracker
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/cli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'thor'

module GoodJob
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
#
# +GoodJob::Configuration+ provides normalized configuration information to
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/cron_manager.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "concurrent/hash"
require "concurrent/scheduled_task"
require "fugit"
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/current_thread.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/module/attribute_accessors_per_thread'

module GoodJob
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/daemon.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
#
# Manages daemonization of the current process.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/engine.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Ruby on Rails integration.
class Engine < ::Rails::Engine
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/interrupt_error.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Exception raised when a job is interrupted by a SIGKILL or power failure.
class InterruptError < StandardError
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/job_performer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'concurrent/delay'

module GoodJob
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/log_subscriber.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
#
# Listens to GoodJob notifications and logs them.
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/metrics.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob # :nodoc:
# Metrics for the scheduler.
class Metrics
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/multi_scheduler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# Delegates the interface of a single {Scheduler} to multiple Schedulers.
class MultiScheduler
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/notifier.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/module/attribute_accessors_per_thread'
require 'concurrent/atomic/atomic_boolean'
require "good_job/notifier/process_heartbeat"
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/poller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'concurrent/atomic/atomic_boolean'

module GoodJob # :nodoc:
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/scheduler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "concurrent/executor/thread_pool_executor"
require "concurrent/executor/timer_set"
require "concurrent/scheduled_task"
Expand Down
1 change: 1 addition & 0 deletions lib/good_job/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module GoodJob
# GoodJob gem version.
VERSION = '3.15.14'
Expand Down
1 change: 1 addition & 0 deletions spec/app/charts/good_job/scheduled_by_queue_chart_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe GoodJob::ScheduledByQueueChart do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe GoodJob::ApplicationController, type: :controller do
Expand Down
Loading

0 comments on commit e6be97f

Please sign in to comment.