diff --git a/.rubocop.yml b/.rubocop.yml index d7c5eee3..369a4037 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -152,6 +152,9 @@ Style/ExponentialNotation: Style/FormatStringToken: Enabled: false +Style/FrozenStringLiteralComment: + EnforcedStyle: always_true + Style/GuardClause: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d4f4309b..9907ef22 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -49,13 +49,6 @@ Style/OptionalBooleanParameter: - 'app/jobs/analyze_change_job.rb' - 'app/models/application_record.rb' -# Offense count: 67 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: when_needed, always, never -Style/FrozenStringLiteralComment: - Enabled: false - # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. diff --git a/Gemfile b/Gemfile index 3c98873a..ceb8299c 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,9 @@ gem 'hiredis' gem 'sentry-ruby', '~> 5.26.0' gem 'sentry-rails', '~> 5.26.0' +# We don't make direct use of this; it's really here to suppress a warning about upcoming changes to bundled gems. +gem "pstore", "~> 0.2.0" + # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/Gemfile.lock b/Gemfile.lock index 15885cd9..db250f6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -268,6 +268,7 @@ GEM method_source (~> 1.0) pry-rails (0.3.11) pry (>= 0.13.0) + pstore (0.2.0) psych (5.2.6) date stringio @@ -468,6 +469,7 @@ DEPENDENCIES pg (~> 1.6) postmark-rails pry-rails + pstore (~> 0.2.0) puma (~> 7.1) pundit (~> 2.5.2) rack-brotli diff --git a/Rakefile b/Rakefile index e85f9139..488c551f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index d6726972..9aec2305 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationCable class Channel < ActionCable::Channel::Base end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 0ff5442f..8d6c2a1b 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationCable class Connection < ActionCable::Connection::Base end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 3d74aff1..9e4daebe 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class UsersController < ApplicationController before_action :authenticate_user! diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 34a8f883..0af0378b 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AdminController < ApplicationController protect_from_forgery with: :exception diff --git a/app/controllers/api/v0/annotations_controller.rb b/app/controllers/api/v0/annotations_controller.rb index f08960b5..013fc9f7 100644 --- a/app/controllers/api/v0/annotations_controller.rb +++ b/app/controllers/api/v0/annotations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::AnnotationsController < Api::V0::ApiController include SortingConcern include BlockedParamsConcern diff --git a/app/controllers/api/v0/api_controller.rb b/app/controllers/api/v0/api_controller.rb index 87cf3fd1..04fa62d5 100644 --- a/app/controllers/api/v0/api_controller.rb +++ b/app/controllers/api/v0/api_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::ApiController < ApplicationController skip_forgery_protection diff --git a/app/controllers/api/v0/changes_controller.rb b/app/controllers/api/v0/changes_controller.rb index 1acdd803..4566cdc0 100644 --- a/app/controllers/api/v0/changes_controller.rb +++ b/app/controllers/api/v0/changes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::ChangesController < Api::V0::ApiController include SortingConcern include BlockedParamsConcern diff --git a/app/controllers/api/v0/diff_controller.rb b/app/controllers/api/v0/diff_controller.rb index 85b8ff51..287441f6 100644 --- a/app/controllers/api/v0/diff_controller.rb +++ b/app/controllers/api/v0/diff_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::DiffController < Api::V0::ApiController def show ensure_diffable diff --git a/app/controllers/api/v0/imports_controller.rb b/app/controllers/api/v0/imports_controller.rb index 35aae8f8..61b8a4c8 100644 --- a/app/controllers/api/v0/imports_controller.rb +++ b/app/controllers/api/v0/imports_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::ImportsController < Api::V0::ApiController before_action { authorize :api, :import? } diff --git a/app/controllers/api/v0/maintainers_controller.rb b/app/controllers/api/v0/maintainers_controller.rb index be080a1f..9e612f6f 100644 --- a/app/controllers/api/v0/maintainers_controller.rb +++ b/app/controllers/api/v0/maintainers_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::MaintainersController < Api::V0::ApiController include SortingConcern diff --git a/app/controllers/api/v0/pages_controller.rb b/app/controllers/api/v0/pages_controller.rb index 613a37a1..d6d07ca7 100644 --- a/app/controllers/api/v0/pages_controller.rb +++ b/app/controllers/api/v0/pages_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::PagesController < Api::V0::ApiController include SortingConcern include BlockedParamsConcern diff --git a/app/controllers/api/v0/tags_controller.rb b/app/controllers/api/v0/tags_controller.rb index f0a2d93f..80025073 100644 --- a/app/controllers/api/v0/tags_controller.rb +++ b/app/controllers/api/v0/tags_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::TagsController < Api::V0::ApiController include SortingConcern diff --git a/app/controllers/api/v0/urls_controller.rb b/app/controllers/api/v0/urls_controller.rb index bae56a7f..0d75bd95 100644 --- a/app/controllers/api/v0/urls_controller.rb +++ b/app/controllers/api/v0/urls_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::UrlsController < Api::V0::ApiController before_action(except: [:index, :show]) { authorize(:api, :import?) } diff --git a/app/controllers/api/v0/versions_controller.rb b/app/controllers/api/v0/versions_controller.rb index c8d7d8b7..2aa2028a 100644 --- a/app/controllers/api/v0/versions_controller.rb +++ b/app/controllers/api/v0/versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::V0::VersionsController < Api::V0::ApiController include SortingConcern include BlockedParamsConcern diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a6403c47..9fabb63f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base include Pundit::Authorization include SameOriginSessionsConcern diff --git a/app/controllers/concerns/blocked_params_concern.rb b/app/controllers/concerns/blocked_params_concern.rb index da29d13e..a1c6673f 100644 --- a/app/controllers/concerns/blocked_params_concern.rb +++ b/app/controllers/concerns/blocked_params_concern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Block unauthenticated requests that use certain params with a 403 (Forbidden) # error. This can be used to prevent abuse of options that may cause expensive # operations. diff --git a/app/controllers/concerns/paging_concern.rb b/app/controllers/concerns/paging_concern.rb index c7f59914..4fcbd857 100644 --- a/app/controllers/concerns/paging_concern.rb +++ b/app/controllers/concerns/paging_concern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PagingConcern extend ActiveSupport::Concern diff --git a/app/controllers/concerns/same_origin_sessions_concern.rb b/app/controllers/concerns/same_origin_sessions_concern.rb index d027c5af..ca4bd4db 100644 --- a/app/controllers/concerns/same_origin_sessions_concern.rb +++ b/app/controllers/concerns/same_origin_sessions_concern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Make sessions available only to requests from the same host as the server. # # This means sessions work for people browsing this site directly, but not for diff --git a/app/controllers/concerns/sorting_concern.rb b/app/controllers/concerns/sorting_concern.rb index 28fac8be..0fe87941 100644 --- a/app/controllers/concerns/sorting_concern.rb +++ b/app/controllers/concerns/sorting_concern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SortingConcern extend ActiveSupport::Concern diff --git a/app/controllers/healthcheck_controller.rb b/app/controllers/healthcheck_controller.rb index 30040780..cfeed412 100644 --- a/app/controllers/healthcheck_controller.rb +++ b/app/controllers/healthcheck_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HealthcheckController < ApplicationController def index # Succeed if the app is running, but provide additional diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ab78cb62..3352b9cb 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HomeController < ApplicationController def index render diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 466215eb..13d755b8 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Users::RegistrationsController < Devise::RegistrationsController # before_action :configure_sign_up_params, only: [:create] # before_action :configure_account_update_params, only: [:update] diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 7e499f17..f7e5ed82 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Users::SessionsController < Devise::SessionsController skip_forgery_protection diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be794..15b06f0f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + module ApplicationHelper end diff --git a/app/jobs/analyze_change_job.rb b/app/jobs/analyze_change_job.rb index 13805776..30fe132e 100644 --- a/app/jobs/analyze_change_job.rb +++ b/app/jobs/analyze_change_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # NOTE: THIS JOB IS NOT IN ACTIVE USE. # The use cases it served were better solved by the task-sheets project # (https://github.com/edgi-govdata-archiving/web-monitoring-task-sheets). diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index a009ace5..d92ffddc 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class ApplicationJob < ActiveJob::Base end diff --git a/app/jobs/import_versions_job.rb b/app/jobs/import_versions_job.rb index e549766d..b19e9092 100644 --- a/app/jobs/import_versions_job.rb +++ b/app/jobs/import_versions_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ImportVersionsJob < ApplicationJob queue_as :import diff --git a/app/lib/data_helpers.rb b/app/lib/data_helpers.rb index 96a77bd3..cd9ad3b8 100644 --- a/app/lib/data_helpers.rb +++ b/app/lib/data_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Tools for working with database data. These are mostly used in rake tasks and migrations. module DataHelpers class ProgressLogger diff --git a/app/lib/numeric_interval.rb b/app/lib/numeric_interval.rb index ce6d5c5c..890cd81d 100644 --- a/app/lib/numeric_interval.rb +++ b/app/lib/numeric_interval.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NumericInterval attr_reader :start, :start_open attr_reader :end, :end_open diff --git a/app/lib/surt.rb b/app/lib/surt.rb index a1966667..dfd66d13 100644 --- a/app/lib/surt.rb +++ b/app/lib/surt.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'addressable/uri' # Tools for canonicalizing and formatting URLs according to the Internet diff --git a/app/lib/surt/canonicalize.rb b/app/lib/surt/canonicalize.rb index 25b21141..c291c383 100644 --- a/app/lib/surt/canonicalize.rb +++ b/app/lib/surt/canonicalize.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'addressable/uri' module Surt::Canonicalize @@ -83,7 +85,7 @@ module Surt::Canonicalize # test fails if we just use Addressable's standard set. Maybe drop this? # Also validate against the original Java version: # https://github.com/iipc/webarchive-commons/blob/5fb641b7ff3c63ade0eb39782fc8b1982ea27330/src/main/java/org/archive/url/BasicURLCanonicalizer.java#L219-L275 - URL_SPECIAL_CHARACTERS = '!"$&\'()*+,-./:;<=>?@[\]^_`{|}~'.freeze + URL_SPECIAL_CHARACTERS = '!"$&\'()*+,-./:;<=>?@[\]^_`{|}~' SAFE_CHARACTERS = "0-9a-zA-Z#{Regexp.escape(URL_SPECIAL_CHARACTERS)}".freeze # Canonicalize a URL. This is the normal entrypoint to this module. diff --git a/app/lib/surt/format.rb b/app/lib/surt/format.rb index b2a024b2..d8ad270a 100644 --- a/app/lib/surt/format.rb +++ b/app/lib/surt/format.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Surt::Format DEFAULT_OPTIONS = { include_scheme: false, diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 286b2239..d84cb6e7 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' diff --git a/app/mailers/invitation_mailer.rb b/app/mailers/invitation_mailer.rb index f6bbba7e..f94b4c98 100644 --- a/app/mailers/invitation_mailer.rb +++ b/app/mailers/invitation_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class InvitationMailer < ApplicationMailer def invitation_email(invitation) @invitation = invitation diff --git a/app/models/annotation.rb b/app/models/annotation.rb index 66af502a..44bd56ef 100644 --- a/app/models/annotation.rb +++ b/app/models/annotation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Annotation < ApplicationRecord include UuidPrimaryKey diff --git a/app/models/application_record.rb b/app/models/application_record.rb index e1e6f8bd..87f3362a 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationRecord < ActiveRecord::Base self.abstract_class = true diff --git a/app/models/change.rb b/app/models/change.rb index 8b12c473..b4769af3 100644 --- a/app/models/change.rb +++ b/app/models/change.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Change < ApplicationRecord include UuidPrimaryKey diff --git a/app/models/concerns/simple_title.rb b/app/models/concerns/simple_title.rb index 6a4555f0..3ce7cacf 100644 --- a/app/models/concerns/simple_title.rb +++ b/app/models/concerns/simple_title.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SimpleTitle extend ActiveSupport::Concern diff --git a/app/models/concerns/taggable.rb b/app/models/concerns/taggable.rb index fb3119e2..c1b79af7 100644 --- a/app/models/concerns/taggable.rb +++ b/app/models/concerns/taggable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Taggable extend ActiveSupport::Concern diff --git a/app/models/concerns/uuid_primary_key.rb b/app/models/concerns/uuid_primary_key.rb index e59bb32a..d3eb8324 100644 --- a/app/models/concerns/uuid_primary_key.rb +++ b/app/models/concerns/uuid_primary_key.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UuidPrimaryKey extend ActiveSupport::Concern diff --git a/app/models/import.rb b/app/models/import.rb index 9791a3ae..8e792e01 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Import < ApplicationRecord belongs_to :user enum :status, [:pending, :processing, :complete] diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 19abc731..90f435fb 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Invitation < ApplicationRecord EXPIRATION_DAYS = 14 diff --git a/app/models/maintainer.rb b/app/models/maintainer.rb index 1046e38c..e1880daf 100644 --- a/app/models/maintainer.rb +++ b/app/models/maintainer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Maintainer represents an organization that maintains some web pages. It has # a name and an optional link to a parent maintainer so there can be a # hierarchical relationship (e.g. an office of a department of an organization) diff --git a/app/models/maintainership.rb b/app/models/maintainership.rb index 57f28a8d..da550188 100644 --- a/app/models/maintainership.rb +++ b/app/models/maintainership.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Maintainership < ApplicationRecord belongs_to :maintainer, foreign_key: :maintainer_uuid belongs_to :page, foreign_key: :page_uuid diff --git a/app/models/merged_page.rb b/app/models/merged_page.rb index 53856348..3c1793c3 100644 --- a/app/models/merged_page.rb +++ b/app/models/merged_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # MergedPage keeps track of pages that were merged into others so we can # support old links by redirecting to the page they were merged into. # - The primary key is the ID of the page that was merged and removed diff --git a/app/models/page.rb b/app/models/page.rb index 2d53e70e..98622a7a 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Page < ApplicationRecord include UuidPrimaryKey include Taggable diff --git a/app/models/page_url.rb b/app/models/page_url.rb index aa24943c..866bcdb8 100644 --- a/app/models/page_url.rb +++ b/app/models/page_url.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # PageUrl is a critical part of each Page model. Pages do not represent a # single URL -- pages are often reachable from multiple URLs (sometimes at # the same time; sometimes because a page moves over time) and different diff --git a/app/models/tag.rb b/app/models/tag.rb index f980bc8a..8961f09e 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Tag < ApplicationRecord include UuidPrimaryKey diff --git a/app/models/tagging.rb b/app/models/tagging.rb index c55ded66..33f26350 100644 --- a/app/models/tagging.rb +++ b/app/models/tagging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Tagging < ApplicationRecord belongs_to :taggable, polymorphic: true, foreign_key: :taggable_uuid belongs_to :tag, inverse_of: :taggings, foreign_key: :tag_uuid diff --git a/app/models/user.rb b/app/models/user.rb index 62816186..fdc207c4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + class User < ApplicationRecord PERMISSIONS = [ - VIEW_PERMISSION = 'view'.freeze, - ANNOTATE_PERMISSION = 'annotate'.freeze, - IMPORT_PERMISSION = 'import'.freeze, - MANAGE_USERS_PERMISSION = 'manage_users'.freeze + VIEW_PERMISSION = 'view', + ANNOTATE_PERMISSION = 'annotate', + IMPORT_PERMISSION = 'import', + MANAGE_USERS_PERMISSION = 'manage_users' ].freeze PERMISSION_DESCRIPTIONS = { diff --git a/app/models/version.rb b/app/models/version.rb index 09d10528..326fb602 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Version < ApplicationRecord include UuidPrimaryKey include SimpleTitle diff --git a/app/policies/admin_policy.rb b/app/policies/admin_policy.rb index e166cdfe..cf397481 100644 --- a/app/policies/admin_policy.rb +++ b/app/policies/admin_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AdminPolicy < ApplicationPolicy def any? user.can_manage_users? diff --git a/app/policies/api_policy.rb b/app/policies/api_policy.rb index 9a6f3346..9302e8a1 100644 --- a/app/policies/api_policy.rb +++ b/app/policies/api_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApiPolicy < ApplicationPolicy def view? Rails.configuration.allow_public_view || (user.present? && user.can_view?) diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb index eefe976c..50f2d7c6 100644 --- a/app/policies/application_policy.rb +++ b/app/policies/application_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationPolicy attr_reader :user, :record diff --git a/app/validators/contains_only_validator.rb b/app/validators/contains_only_validator.rb index 00081686..0d8c2f36 100644 --- a/app/validators/contains_only_validator.rb +++ b/app/validators/contains_only_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ContainsOnlyValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value.is_a?(Array) diff --git a/bin/bundle b/bin/bundle index f19acf5b..2dbb7176 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) load Gem.bin_path('bundler', 'bundle') diff --git a/bin/dev b/bin/dev index 52088a38..39257831 100755 --- a/bin/dev +++ b/bin/dev @@ -1,2 +1,4 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + exec './bin/rails', 'server', *ARGV diff --git a/bin/lint b/bin/lint index ec500a17..1126e666 100755 --- a/bin/lint +++ b/bin/lint @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'fileutils' require 'optparse' include FileUtils # rubocop:disable Style/MixinUsage diff --git a/bin/rails b/bin/rails index 07396602..a31728ab 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489..c1999550 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/setup b/bin/setup index c52d4761..bfeb79b6 100755 --- a/bin/setup +++ b/bin/setup @@ -1,8 +1,10 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'fileutils' APP_ROOT = File.expand_path('..', __dir__) -APP_NAME = 'webpage-versions-db'.freeze +APP_NAME = 'webpage-versions-db' def system!(*) system(*, exception: true) diff --git a/bin/thrust b/bin/thrust index eea4a0a2..78bfb7c1 100755 --- a/bin/thrust +++ b/bin/thrust @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'rubygems' require 'bundler/setup' diff --git a/bin/update b/bin/update index 05737c27..73dd1c3f 100755 --- a/bin/update +++ b/bin/update @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'fileutils' include FileUtils # rubocop:disable Style/MixinUsage diff --git a/bin/yarn b/bin/yarn index 81499bff..72de7857 100755 --- a/bin/yarn +++ b/bin/yarn @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'pathname' APP_ROOT = File.expand_path('..', __dir__) diff --git a/config.ru b/config.ru index ad1fbf29..6dc83218 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require_relative 'config/environment' diff --git a/db/migrate/20170302233652_devise_create_users.rb b/db/migrate/20170302233652_devise_create_users.rb index e43828f1..0837a1c2 100644 --- a/db/migrate/20170302233652_devise_create_users.rb +++ b/db/migrate/20170302233652_devise_create_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DeviseCreateUsers < ActiveRecord::Migration[5.0] def change create_table :users do |t| diff --git a/db/migrate/20170303213937_create_invitations.rb b/db/migrate/20170303213937_create_invitations.rb index 4581b37b..19e2b373 100644 --- a/db/migrate/20170303213937_create_invitations.rb +++ b/db/migrate/20170303213937_create_invitations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateInvitations < ActiveRecord::Migration[5.0] def change create_table :invitations do |t| diff --git a/db/migrate/20170313192244_create_new_db_schema_with_generic_page_version_change_annotation.rb b/db/migrate/20170313192244_create_new_db_schema_with_generic_page_version_change_annotation.rb index 413d8147..af464c1d 100644 --- a/db/migrate/20170313192244_create_new_db_schema_with_generic_page_version_change_annotation.rb +++ b/db/migrate/20170313192244_create_new_db_schema_with_generic_page_version_change_annotation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateNewDbSchemaWithGenericPageVersionChangeAnnotation < ActiveRecord::Migration[5.0] def change # Since 9.4, PostgreSQL recommends using `pgcrypto`'s `gen_random_uuid()` diff --git a/db/migrate/20170425211418_add_missing_page_schemes.rb b/db/migrate/20170425211418_add_missing_page_schemes.rb index c5822a1a..ede71694 100644 --- a/db/migrate/20170425211418_add_missing_page_schemes.rb +++ b/db/migrate/20170425211418_add_missing_page_schemes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMissingPageSchemes < ActiveRecord::Migration[5.0] def up Page.where("url NOT LIKE 'http://%' AND url NOT LIKE 'https://%' AND url NOT LIKE 'ftp://%'").each(&:save) diff --git a/db/migrate/20170429002015_create_imports.rb b/db/migrate/20170429002015_create_imports.rb index ec4139aa..44a44182 100644 --- a/db/migrate/20170429002015_create_imports.rb +++ b/db/migrate/20170429002015_create_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateImports < ActiveRecord::Migration[5.0] def change create_table :imports do |t| diff --git a/db/migrate/20170508221326_add_indexes_for_importing.rb b/db/migrate/20170508221326_add_indexes_for_importing.rb index 250bfc3c..b84e38e6 100644 --- a/db/migrate/20170508221326_add_indexes_for_importing.rb +++ b/db/migrate/20170508221326_add_indexes_for_importing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexesForImporting < ActiveRecord::Migration[5.0] def change add_index :versions, :capture_time diff --git a/db/migrate/20170517222310_change_annotation_author_to_not_null.rb b/db/migrate/20170517222310_change_annotation_author_to_not_null.rb index aaada77a..d165dfbb 100644 --- a/db/migrate/20170517222310_change_annotation_author_to_not_null.rb +++ b/db/migrate/20170517222310_change_annotation_author_to_not_null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeAnnotationAuthorToNotNull < ActiveRecord::Migration[5.1] def do_sql(*args) expression = ActiveRecord::Base.send :sanitize_sql, args diff --git a/db/migrate/20170713234650_set_change_priority_default_to_null.rb b/db/migrate/20170713234650_set_change_priority_default_to_null.rb index 2dfa07a8..60b7eaa6 100644 --- a/db/migrate/20170713234650_set_change_priority_default_to_null.rb +++ b/db/migrate/20170713234650_set_change_priority_default_to_null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SetChangePriorityDefaultToNull < ActiveRecord::Migration[5.1] def do_sql(*args) expression = ActiveRecord::Base.send :sanitize_sql, args diff --git a/db/migrate/20170717072416_add_significance_to_change.rb b/db/migrate/20170717072416_add_significance_to_change.rb index 8382b678..b98add25 100644 --- a/db/migrate/20170717072416_add_significance_to_change.rb +++ b/db/migrate/20170717072416_add_significance_to_change.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSignificanceToChange < ActiveRecord::Migration[5.1] def change add_column(:changes, :significance, :float, null: true, default: nil) diff --git a/db/migrate/20170801192038_add_update_behavior_to_import.rb b/db/migrate/20170801192038_add_update_behavior_to_import.rb index 2a462459..ba773dc1 100644 --- a/db/migrate/20170801192038_add_update_behavior_to_import.rb +++ b/db/migrate/20170801192038_add_update_behavior_to_import.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUpdateBehaviorToImport < ActiveRecord::Migration[5.1] def change add_column(:imports, :update_behavior, :integer, default: 0, null: false) diff --git a/db/migrate/20170909151007_add_title_to_versions.rb b/db/migrate/20170909151007_add_title_to_versions.rb index 3584e3c0..32e59216 100644 --- a/db/migrate/20170909151007_add_title_to_versions.rb +++ b/db/migrate/20170909151007_add_title_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTitleToVersions < ActiveRecord::Migration[5.1] def change add_column :versions, :title, :string diff --git a/db/migrate/20170914154249_change_error_code_to_snake_case.rb b/db/migrate/20170914154249_change_error_code_to_snake_case.rb index b06f93bf..f6c63ec3 100644 --- a/db/migrate/20170914154249_change_error_code_to_snake_case.rb +++ b/db/migrate/20170914154249_change_error_code_to_snake_case.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeErrorCodeToSnakeCase < ActiveRecord::Migration[5.1] def do_sql(*args) expression = ActiveRecord::Base.send :sanitize_sql, args diff --git a/db/migrate/20171101214731_remove_page_uuid_site_index.rb b/db/migrate/20171101214731_remove_page_uuid_site_index.rb index 687a01c8..912a25d4 100644 --- a/db/migrate/20171101214731_remove_page_uuid_site_index.rb +++ b/db/migrate/20171101214731_remove_page_uuid_site_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemovePageUuidSiteIndex < ActiveRecord::Migration[5.1] def change add_index :pages, :site diff --git a/db/migrate/20180128062846_create_maintainers.rb b/db/migrate/20180128062846_create_maintainers.rb index ff0c7388..1d6bfded 100644 --- a/db/migrate/20180128062846_create_maintainers.rb +++ b/db/migrate/20180128062846_create_maintainers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateMaintainers < ActiveRecord::Migration[5.1] def change enable_extension :citext diff --git a/db/migrate/20180207031149_create_tags.rb b/db/migrate/20180207031149_create_tags.rb index a3b1d643..6c4273eb 100644 --- a/db/migrate/20180207031149_create_tags.rb +++ b/db/migrate/20180207031149_create_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateTags < ActiveRecord::Migration[5.1] def change enable_extension :citext diff --git a/db/migrate/20180207061655_copy_agency_and_site_fields_to_associated_models.rb b/db/migrate/20180207061655_copy_agency_and_site_fields_to_associated_models.rb index 1d3c4974..6eaecaf2 100644 --- a/db/migrate/20180207061655_copy_agency_and_site_fields_to_associated_models.rb +++ b/db/migrate/20180207061655_copy_agency_and_site_fields_to_associated_models.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CopyAgencyAndSiteFieldsToAssociatedModels < ActiveRecord::Migration[5.1] def up DataHelpers.iterate_each(Page.order(created_at: :asc)) do |page| diff --git a/db/migrate/20180212043742_dedupe_pages_with_multiple_agencies_or_sites.rb b/db/migrate/20180212043742_dedupe_pages_with_multiple_agencies_or_sites.rb index 291c07a1..c08b745e 100644 --- a/db/migrate/20180212043742_dedupe_pages_with_multiple_agencies_or_sites.rb +++ b/db/migrate/20180212043742_dedupe_pages_with_multiple_agencies_or_sites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DedupePagesWithMultipleAgenciesOrSites < ActiveRecord::Migration[5.1] # Find all pages sharing the same URL and de-duplicate them by copying the # maintainers, tags, and versions of all subsequent pages onto the one that diff --git a/db/migrate/20180227021126_add_capture_url_to_version.rb b/db/migrate/20180227021126_add_capture_url_to_version.rb index 6e9395d0..bce572c0 100644 --- a/db/migrate/20180227021126_add_capture_url_to_version.rb +++ b/db/migrate/20180227021126_add_capture_url_to_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCaptureUrlToVersion < ActiveRecord::Migration[5.1] def change add_column :versions, :capture_url, :string diff --git a/db/migrate/20180227024610_add_url_key_to_page.rb b/db/migrate/20180227024610_add_url_key_to_page.rb index 6a92d6d6..73ca9f8d 100644 --- a/db/migrate/20180227024610_add_url_key_to_page.rb +++ b/db/migrate/20180227024610_add_url_key_to_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUrlKeyToPage < ActiveRecord::Migration[5.1] def change add_column :pages, :url_key, :string diff --git a/db/migrate/20180227034314_dedupe_pages_with_matching_url_keys.rb b/db/migrate/20180227034314_dedupe_pages_with_matching_url_keys.rb index 9883cb6a..a04eecdc 100644 --- a/db/migrate/20180227034314_dedupe_pages_with_matching_url_keys.rb +++ b/db/migrate/20180227034314_dedupe_pages_with_matching_url_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DedupePagesWithMatchingUrlKeys < ActiveRecord::Migration[5.1] # Find all pages sharing the same `url_key` and de-duplicate them by copying # the maintainers, tags, and versions of all subsequent pages onto the one diff --git a/db/migrate/20180413051144_add_create_pages_to_imports.rb b/db/migrate/20180413051144_add_create_pages_to_imports.rb index 66f1dada..e1316e64 100644 --- a/db/migrate/20180413051144_add_create_pages_to_imports.rb +++ b/db/migrate/20180413051144_add_create_pages_to_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCreatePagesToImports < ActiveRecord::Migration[5.1] def change add_column :imports, :create_pages, :boolean, null: false, default: true diff --git a/db/migrate/20180415063842_add_processing_warnings_to_imports.rb b/db/migrate/20180415063842_add_processing_warnings_to_imports.rb index 00680890..b6beb3a9 100644 --- a/db/migrate/20180415063842_add_processing_warnings_to_imports.rb +++ b/db/migrate/20180415063842_add_processing_warnings_to_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddProcessingWarningsToImports < ActiveRecord::Migration[5.1] def change add_column :imports, :processing_warnings, :jsonb diff --git a/db/migrate/20180415065623_add_different_to_versions.rb b/db/migrate/20180415065623_add_different_to_versions.rb index 10906804..314a6d92 100644 --- a/db/migrate/20180415065623_add_different_to_versions.rb +++ b/db/migrate/20180415065623_add_different_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDifferentToVersions < ActiveRecord::Migration[5.1] def change add_column :versions, :different, :boolean, default: true diff --git a/db/migrate/20180418061850_add_skip_unchanged_versions_to_imports.rb b/db/migrate/20180418061850_add_skip_unchanged_versions_to_imports.rb index 2f03ee8b..5f80115a 100644 --- a/db/migrate/20180418061850_add_skip_unchanged_versions_to_imports.rb +++ b/db/migrate/20180418061850_add_skip_unchanged_versions_to_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSkipUnchangedVersionsToImports < ActiveRecord::Migration[5.1] def change add_column :imports, :skip_unchanged_versions, :boolean, null: false, default: false diff --git a/db/migrate/20181128194410_add_active_to_pages.rb b/db/migrate/20181128194410_add_active_to_pages.rb index dcc412c8..188a1899 100644 --- a/db/migrate/20181128194410_add_active_to_pages.rb +++ b/db/migrate/20181128194410_add_active_to_pages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddActiveToPages < ActiveRecord::Migration[5.2] def change add_column :pages, :active, :boolean, default: true diff --git a/db/migrate/20181204192154_add_status_to_versions_and_pages.rb b/db/migrate/20181204192154_add_status_to_versions_and_pages.rb index 3b76ff0a..63466ab2 100644 --- a/db/migrate/20181204192154_add_status_to_versions_and_pages.rb +++ b/db/migrate/20181204192154_add_status_to_versions_and_pages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddStatusToVersionsAndPages < ActiveRecord::Migration[5.2] def change add_column :versions, :status, :integer, null: true diff --git a/db/migrate/20190518154841_add_permissions_to_users.rb b/db/migrate/20190518154841_add_permissions_to_users.rb index 52da6036..78a00fb3 100644 --- a/db/migrate/20190518154841_add_permissions_to_users.rb +++ b/db/migrate/20190518154841_add_permissions_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPermissionsToUsers < ActiveRecord::Migration[5.2] def up add_column :users, :permissions, :string, array: true, default: [] diff --git a/db/migrate/20190531175430_remove_admin_from_users.rb b/db/migrate/20190531175430_remove_admin_from_users.rb index 70e3174a..c6698bb0 100644 --- a/db/migrate/20190531175430_remove_admin_from_users.rb +++ b/db/migrate/20190531175430_remove_admin_from_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveAdminFromUsers < ActiveRecord::Migration[5.2] def up remove_column :users, :admin diff --git a/db/migrate/20190617231901_add_common_indexes_to_versions.rb b/db/migrate/20190617231901_add_common_indexes_to_versions.rb index 62b33fbe..4c2a9108 100644 --- a/db/migrate/20190617231901_add_common_indexes_to_versions.rb +++ b/db/migrate/20190617231901_add_common_indexes_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCommonIndexesToVersions < ActiveRecord::Migration[5.2] # Add indexes to support some common queries we do that should be faster. def change diff --git a/db/migrate/20191101194241_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb b/db/migrate/20191101194241_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb index ff5d72c7..7818547c 100644 --- a/db/migrate/20191101194241_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb +++ b/db/migrate/20191101194241_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20180723000244) class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] def up diff --git a/db/migrate/20200216215324_add_length_and_media_type_to_versions.rb b/db/migrate/20200216215324_add_length_and_media_type_to_versions.rb index 4a185298..759631a4 100644 --- a/db/migrate/20200216215324_add_length_and_media_type_to_versions.rb +++ b/db/migrate/20200216215324_add_length_and_media_type_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLengthAndMediaTypeToVersions < ActiveRecord::Migration[6.0] def change add_column :versions, :content_length, :integer, null: true diff --git a/db/migrate/20201111182822_remove_site_and_agency_from_page.rb b/db/migrate/20201111182822_remove_site_and_agency_from_page.rb index 9b726179..4d4bdbb1 100644 --- a/db/migrate/20201111182822_remove_site_and_agency_from_page.rb +++ b/db/migrate/20201111182822_remove_site_and_agency_from_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveSiteAndAgencyFromPage < ActiveRecord::Migration[6.0] def change remove_column(:pages, :site, :string) diff --git a/db/migrate/20201112194523_remove_media_type_parameters_from_version.rb b/db/migrate/20201112194523_remove_media_type_parameters_from_version.rb index 711a4087..349aedad 100644 --- a/db/migrate/20201112194523_remove_media_type_parameters_from_version.rb +++ b/db/migrate/20201112194523_remove_media_type_parameters_from_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveMediaTypeParametersFromVersion < ActiveRecord::Migration[6.0] def change remove_column :versions, :media_type_parameters, :string, null: true diff --git a/db/migrate/20201116224426_add_page_url_model.rb b/db/migrate/20201116224426_add_page_url_model.rb index de9be965..6a138b08 100644 --- a/db/migrate/20201116224426_add_page_url_model.rb +++ b/db/migrate/20201116224426_add_page_url_model.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPageUrlModel < ActiveRecord::Migration[6.0] def change create_table :page_urls, id: false do |t| diff --git a/db/migrate/20210101232014_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20210101232014_add_service_name_to_active_storage_blobs.active_storage.rb index 64e0ee43..0fa6bd93 100644 --- a/db/migrate/20210101232014_add_service_name_to_active_storage_blobs.active_storage.rb +++ b/db/migrate/20210101232014_add_service_name_to_active_storage_blobs.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20190112182829) class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] def up diff --git a/db/migrate/20210101232015_create_active_storage_variant_records.active_storage.rb b/db/migrate/20210101232015_create_active_storage_variant_records.active_storage.rb index 67015fc4..23b07e35 100644 --- a/db/migrate/20210101232015_create_active_storage_variant_records.active_storage.rb +++ b/db/migrate/20210101232015_create_active_storage_variant_records.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20191206030411) class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] def change diff --git a/db/migrate/20210605234433_rename_version_url_uri_hash_length_headers.rb b/db/migrate/20210605234433_rename_version_url_uri_hash_length_headers.rb index db18d048..ae5f7dc7 100644 --- a/db/migrate/20210605234433_rename_version_url_uri_hash_length_headers.rb +++ b/db/migrate/20210605234433_rename_version_url_uri_hash_length_headers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RenameVersionUrlUriHashLengthHeaders < ActiveRecord::Migration[6.1] def change change_table :versions do |t| diff --git a/db/migrate/20220901211031_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20220901211031_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb index 93c8b85a..6f318221 100644 --- a/db/migrate/20220901211031_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +++ b/db/migrate/20220901211031_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20211119233751) class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] def change diff --git a/db/migrate/20230124182815_add_compound_time_uuid_indexes_on_versions.rb b/db/migrate/20230124182815_add_compound_time_uuid_indexes_on_versions.rb index 88c0a61f..5cb07e17 100644 --- a/db/migrate/20230124182815_add_compound_time_uuid_indexes_on_versions.rb +++ b/db/migrate/20230124182815_add_compound_time_uuid_indexes_on_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCompoundTimeUuidIndexesOnVersions < ActiveRecord::Migration[7.0] disable_ddl_transaction! diff --git a/db/migrate/20230124184531_remove_simple_time_indexes_on_versions.rb b/db/migrate/20230124184531_remove_simple_time_indexes_on_versions.rb index 95e3afd1..b251221a 100644 --- a/db/migrate/20230124184531_remove_simple_time_indexes_on_versions.rb +++ b/db/migrate/20230124184531_remove_simple_time_indexes_on_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveSimpleTimeIndexesOnVersions < ActiveRecord::Migration[7.0] def change # Drop indexes on Version time fields. These are now redundant since we diff --git a/db/migrate/20230209200733_change_int_to_bigint_for_primary_keys.rb b/db/migrate/20230209200733_change_int_to_bigint_for_primary_keys.rb index 7e4574a0..d09a233b 100644 --- a/db/migrate/20230209200733_change_int_to_bigint_for_primary_keys.rb +++ b/db/migrate/20230209200733_change_int_to_bigint_for_primary_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeIntToBigintForPrimaryKeys < ActiveRecord::Migration[7.0] def change_serial_primary_key_type(table, key, key_type) change_column table, key, key_type diff --git a/db/migrate/20250202234940_add_network_error_to_versions.rb b/db/migrate/20250202234940_add_network_error_to_versions.rb index d6d85890..64b20c89 100644 --- a/db/migrate/20250202234940_add_network_error_to_versions.rb +++ b/db/migrate/20250202234940_add_network_error_to_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddNetworkErrorToVersions < ActiveRecord::Migration[8.0] def change change_table :versions do |t| diff --git a/db/seeds.rb b/db/seeds.rb index 32703fee..658655c9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Seed the DB with an admin user and a few version records if Archiver.allowed_hosts.empty? puts <<~WARN diff --git a/lib/api/api.rb b/lib/api/api.rb index 64b05a2d..1dd03783 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class ApiError < StandardError end diff --git a/lib/archiver/archiver.rb b/lib/archiver/archiver.rb index 9aace721..126b165a 100644 --- a/lib/archiver/archiver.rb +++ b/lib/archiver/archiver.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'digest' require 'httparty' diff --git a/lib/differ/differ.rb b/lib/differ/differ.rb index 725c51db..2674ee3e 100644 --- a/lib/differ/differ.rb +++ b/lib/differ/differ.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Differ # Register a differ instance to be used for a given diff type. If `type` is # nil, the differ will be treated as the constructor arguments for a differ diff --git a/lib/differ/simple_diff.rb b/lib/differ/simple_diff.rb index 51af8508..d456cb2a 100644 --- a/lib/differ/simple_diff.rb +++ b/lib/differ/simple_diff.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Differ class SimpleDiff MAXIMUM_TRIES = 3 diff --git a/lib/file_storage/file_storage.rb b/lib/file_storage/file_storage.rb index 1ce4e16a..ef395e27 100644 --- a/lib/file_storage/file_storage.rb +++ b/lib/file_storage/file_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'local_file' module FileStorage diff --git a/lib/file_storage/local_file.rb b/lib/file_storage/local_file.rb index afdd1f31..9efc725d 100644 --- a/lib/file_storage/local_file.rb +++ b/lib/file_storage/local_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FileStorage # Store and retrieve files from the local filesystem. class LocalFile diff --git a/lib/file_storage/s3.rb b/lib/file_storage/s3.rb index 31335b18..6ffbd5ee 100644 --- a/lib/file_storage/s3.rb +++ b/lib/file_storage/s3.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'aws-sdk-s3' module FileStorage diff --git a/lib/jwt_tools/jwt_auth_strategy.rb b/lib/jwt_tools/jwt_auth_strategy.rb index c244a55c..cc8eef56 100644 --- a/lib/jwt_tools/jwt_auth_strategy.rb +++ b/lib/jwt_tools/jwt_auth_strategy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JwtTools class JwtAuthStrategy < Devise::Strategies::Base def valid? diff --git a/lib/jwt_tools/jwt_coder.rb b/lib/jwt_tools/jwt_coder.rb index c5e8ef5f..3147bb1f 100644 --- a/lib/jwt_tools/jwt_coder.rb +++ b/lib/jwt_tools/jwt_coder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JwtTools module JwtCoder def self.private_key=(new_key) diff --git a/lib/tasks/analyze_changes.rake b/lib/tasks/analyze_changes.rake index f21dfeef..63fc047b 100644 --- a/lib/tasks/analyze_changes.rake +++ b/lib/tasks/analyze_changes.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Queue up automated analysis for versions added in a given timeframe.' task :analyze_changes, [:start_date, :end_date] => [:environment] do |_t, args| start_date = args.key?(:start_date) ? Time.parse(args[:start_date]) : nil diff --git a/lib/tasks/cache_diffs.rake b/lib/tasks/cache_diffs.rake index aa97208c..1157e804 100644 --- a/lib/tasks/cache_diffs.rake +++ b/lib/tasks/cache_diffs.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + DEFAULT_DIFF_TYPES = [ 'html_token?include=all', 'html_token?include=combined', diff --git a/lib/tasks/copy_data.rake b/lib/tasks/copy_data.rake index dc788240..8eaad3e2 100644 --- a/lib/tasks/copy_data.rake +++ b/lib/tasks/copy_data.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Copy pages from another web-monitoring-db instance.' task :copy_page, [:page_uuid, :include_changes, :url, :username, :password] => [:environment] do |_t, args| verbose = ENV.fetch('VERBOSE', nil) diff --git a/lib/tasks/data/20180926_move_versionista_s3_data.rake b/lib/tasks/data/20180926_move_versionista_s3_data.rake index 1d3135cf..e3201b1d 100644 --- a/lib/tasks/data/20180926_move_versionista_s3_data.rake +++ b/lib/tasks/data/20180926_move_versionista_s3_data.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do # If the database is too big, use the date filters to break the work into # smaller, more time-constrained chunks. diff --git a/lib/tasks/data/20181124_normalize_titles.rake b/lib/tasks/data/20181124_normalize_titles.rake index 49d67bc8..d36b91cf 100644 --- a/lib/tasks/data/20181124_normalize_titles.rake +++ b/lib/tasks/data/20181124_normalize_titles.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Clean up and normalize badly formatted Page and Version titles.' task :'20181124_normalize_titles', [] => [:environment] do |_t| diff --git a/lib/tasks/data/20181204_set_version_status.rake b/lib/tasks/data/20181204_set_version_status.rake index 40ef0dca..c06a0d00 100644 --- a/lib/tasks/data/20181204_set_version_status.rake +++ b/lib/tasks/data/20181204_set_version_status.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Set the `status` field on all versions based on `source_metadata`.' task :'20181204_set_version_status', [] => [:environment] do |_t| diff --git a/lib/tasks/data/20181205_update_version_different.rake b/lib/tasks/data/20181205_update_version_different.rake index 1bee441c..3192ecfe 100644 --- a/lib/tasks/data/20181205_update_version_different.rake +++ b/lib/tasks/data/20181205_update_version_different.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Set the `different` field on all versions.' task :'20181205_update_version_different', [] => [:environment] do |_t| diff --git a/lib/tasks/data/20190112_add_page_domain_tags.rake b/lib/tasks/data/20190112_add_page_domain_tags.rake index 8c20995c..df0e34a9 100644 --- a/lib/tasks/data/20190112_add_page_domain_tags.rake +++ b/lib/tasks/data/20190112_add_page_domain_tags.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Set `domain:` and `2l-domain` tags on all pages.' task :'20190112_add_page_domain_tags', [] => [:environment] do |_t| diff --git a/lib/tasks/data/20200218_add_version_length_media_type.rake b/lib/tasks/data/20200218_add_version_length_media_type.rake index 6d6d7065..e3303048 100644 --- a/lib/tasks/data/20200218_add_version_length_media_type.rake +++ b/lib/tasks/data/20200218_add_version_length_media_type.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Set `content_length`, and `media_type` on all versions.' task :'20200218_add_version_length_media_type', [:force, :start_date, :end_date] => [:environment] do |_t, args| diff --git a/lib/tasks/data/20201116_add_page_urls.rake b/lib/tasks/data/20201116_add_page_urls.rake index c7575eba..91091ff2 100644 --- a/lib/tasks/data/20201116_add_page_urls.rake +++ b/lib/tasks/data/20201116_add_page_urls.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Add default PageUrls to all pages.' task :'20201116_add_page_urls', [] => [:environment] do diff --git a/lib/tasks/data/20210605_fill_version_headers_from_source_metadata.rake b/lib/tasks/data/20210605_fill_version_headers_from_source_metadata.rake index b619ef34..e7fb43af 100644 --- a/lib/tasks/data/20210605_fill_version_headers_from_source_metadata.rake +++ b/lib/tasks/data/20210605_fill_version_headers_from_source_metadata.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Fill in `headers` on versions from `source_metadata.headers`.' task :'20210605_fill_version_headers_from_source_metadata', [:force, :start_date, :end_date] => [:environment] do |_t, args| diff --git a/lib/tasks/data/20230119_remove_bad_versionista_titles.rake b/lib/tasks/data/20230119_remove_bad_versionista_titles.rake index 277006e8..ecf36f73 100644 --- a/lib/tasks/data/20230119_remove_bad_versionista_titles.rake +++ b/lib/tasks/data/20230119_remove_bad_versionista_titles.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Remove bad version titles from Versionista.' task :'20230119_remove_bad_versionista_titles', [] => [:environment] do |_t, _args| diff --git a/lib/tasks/data/20230119_reset_page_titles.rake b/lib/tasks/data/20230119_reset_page_titles.rake index 3fa21bcb..03c41c9f 100644 --- a/lib/tasks/data/20230119_reset_page_titles.rake +++ b/lib/tasks/data/20230119_reset_page_titles.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Reset the titles for all pages based on new logic.' task :'20230119_reset_page_titles', [] => [:environment] do diff --git a/lib/tasks/data/20250330_downcase_header_names.rake b/lib/tasks/data/20250330_downcase_header_names.rake index f58e7562..639ada46 100644 --- a/lib/tasks/data/20250330_downcase_header_names.rake +++ b/lib/tasks/data/20250330_downcase_header_names.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Ensure the names of headers in Version records are downcased.' task :'20250330_downcase_header_names', [:start_date, :end_date] => [:environment] do |_t, args| diff --git a/lib/tasks/data/clean_media_types.rake b/lib/tasks/data/clean_media_types.rake index aef27c00..68e34578 100644 --- a/lib/tasks/data/clean_media_types.rake +++ b/lib/tasks/data/clean_media_types.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Clean up the media_type field on Versions, remap non-canonical to canonical types.' task :clean_media_types, [] => [:environment] do diff --git a/lib/tasks/data/renormalize_urls.rake b/lib/tasks/data/renormalize_urls.rake index 4e140619..96559347 100644 --- a/lib/tasks/data/renormalize_urls.rake +++ b/lib/tasks/data/renormalize_urls.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :data do desc 'Re-normalize the `url` field of Pages and PageUrls`.' task :renormalize_urls, [] => [:environment] do diff --git a/lib/tasks/import_from_sheets.rake b/lib/tasks/import_from_sheets.rake index 5d1b015a..fdc5629e 100644 --- a/lib/tasks/import_from_sheets.rake +++ b/lib/tasks/import_from_sheets.rake @@ -1,10 +1,12 @@ +# frozen_string_literal: true + require 'google/apis/sheets_v4' require 'googleauth' require 'googleauth/stores/file_token_store' -IMPORT_TYPE = 'rake_task_v1'.freeze -OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'.freeze -APPLICATION_NAME = 'Web Monitoring DB Importer'.freeze +IMPORT_TYPE = 'rake_task_v1' +OOB_URI = 'urn:ietf:wg:oauth:2.0:oob' +APPLICATION_NAME = 'Web Monitoring DB Importer' desc 'Create annotations from data in analysts’ Google sheets -- only sheet ID & user e-mail are required.' diff --git a/lib/tasks/invitations.rake b/lib/tasks/invitations.rake index 3d3adfed..fc576769 100644 --- a/lib/tasks/invitations.rake +++ b/lib/tasks/invitations.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Clean out expired invitations' task :remove_expired_invitations, [] => [:environment] do Invitation.expired.each do |invitation| diff --git a/lib/tasks/merge_pages.rake b/lib/tasks/merge_pages.rake index 6ed1a975..ab57ee77 100644 --- a/lib/tasks/merge_pages.rake +++ b/lib/tasks/merge_pages.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Merge multiple pages together. Pages will be merged *into* the first listed.' task :merge_pages, [] => :environment do |_t, args| DataHelpers.with_activerecord_log_level(:error) do diff --git a/lib/tasks/update_page_statuses.rake b/lib/tasks/update_page_statuses.rake index 7cdf539d..81ead041 100644 --- a/lib/tasks/update_page_statuses.rake +++ b/lib/tasks/update_page_statuses.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Update the `status` field on all pages. The first parameter optionally sets what pages to update: "recent" (default, pages updated recently enough to change status), "unknown" (only pages with unknown status), "all" (all pages)' task :update_page_statuses, [:where, :at_time] => [:environment] do |_t, args| where_options = ['recent', 'unknown', 'all'] diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 15e28785..871fa9fe 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' Capybara.save_path = Rails.root.join('tmp') diff --git a/test/controllers/admin/users_controller_test.rb b/test/controllers/admin/users_controller_test.rb index 55f668a7..ce639084 100644 --- a/test/controllers/admin/users_controller_test.rb +++ b/test/controllers/admin/users_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Admin::UsersControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb index a46d735a..dbe19bef 100644 --- a/test/controllers/admin_controller_test.rb +++ b/test/controllers/admin_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class AdminControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/annotations_controller_test.rb b/test/controllers/api/v0/annotations_controller_test.rb index 042003fb..74fbd255 100644 --- a/test/controllers/api/v0/annotations_controller_test.rb +++ b/test/controllers/api/v0/annotations_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::AnnotationsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/changes_controller_test.rb b/test/controllers/api/v0/changes_controller_test.rb index d37e8e2a..c4d0186d 100644 --- a/test/controllers/api/v0/changes_controller_test.rb +++ b/test/controllers/api/v0/changes_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::ChangesControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/diff_controller_test.rb b/test/controllers/api/v0/diff_controller_test.rb index eac8c200..3f7800bb 100644 --- a/test/controllers/api/v0/diff_controller_test.rb +++ b/test/controllers/api/v0/diff_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'minitest/mock' diff --git a/test/controllers/api/v0/imports_controller_test.rb b/test/controllers/api/v0/imports_controller_test.rb index 4d0429c6..e25c0f5c 100644 --- a/test/controllers/api/v0/imports_controller_test.rb +++ b/test/controllers/api/v0/imports_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::ImportsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/maintainers_controller_test.rb b/test/controllers/api/v0/maintainers_controller_test.rb index 78d8c8e7..bd799b37 100644 --- a/test/controllers/api/v0/maintainers_controller_test.rb +++ b/test/controllers/api/v0/maintainers_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::MaintainersControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/pages_controller_test.rb b/test/controllers/api/v0/pages_controller_test.rb index 7b5e3ea4..81764e75 100644 --- a/test/controllers/api/v0/pages_controller_test.rb +++ b/test/controllers/api/v0/pages_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::PagesControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/tags_controller_test.rb b/test/controllers/api/v0/tags_controller_test.rb index 011db251..30947dae 100644 --- a/test/controllers/api/v0/tags_controller_test.rb +++ b/test/controllers/api/v0/tags_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::TagsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/urls_controller_test.rb b/test/controllers/api/v0/urls_controller_test.rb index 3b323065..a6a6c204 100644 --- a/test/controllers/api/v0/urls_controller_test.rb +++ b/test/controllers/api/v0/urls_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::UrlsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/api/v0/versions_controller_test.rb b/test/controllers/api/v0/versions_controller_test.rb index 99a3a13b..b072956b 100644 --- a/test/controllers/api/v0/versions_controller_test.rb +++ b/test/controllers/api/v0/versions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Api::V0::VersionsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/healthcheck_controller_test.rb b/test/controllers/healthcheck_controller_test.rb index 879fc6cf..97d8f13d 100644 --- a/test/controllers/healthcheck_controller_test.rb +++ b/test/controllers/healthcheck_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'minitest/mock' diff --git a/test/controllers/users/registrations_controller_test.rb b/test/controllers/users/registrations_controller_test.rb index de6434c5..f9f26b48 100644 --- a/test/controllers/users/registrations_controller_test.rb +++ b/test/controllers/users/registrations_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Users::RegistrationsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/users/sessions_controller_test.rb b/test/controllers/users/sessions_controller_test.rb index 0597203f..2fa3181f 100644 --- a/test/controllers/users/sessions_controller_test.rb +++ b/test/controllers/users/sessions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Users::SessionsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/jobs/analyze_change_job_test.rb b/test/jobs/analyze_change_job_test.rb index dcec7190..0d10d128 100644 --- a/test/jobs/analyze_change_job_test.rb +++ b/test/jobs/analyze_change_job_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'minitest/mock' diff --git a/test/jobs/import_versions_job_test.rb b/test/jobs/import_versions_job_test.rb index f74a98df..8a0c463e 100644 --- a/test/jobs/import_versions_job_test.rb +++ b/test/jobs/import_versions_job_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ImportVersionsJobTest < ActiveJob::TestCase diff --git a/test/lib/archiver/archiver_test.rb b/test/lib/archiver/archiver_test.rb index 7c395fc2..05b0ed18 100644 --- a/test/lib/archiver/archiver_test.rb +++ b/test/lib/archiver/archiver_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Archiver::ArchiverTest < ActiveSupport::TestCase diff --git a/test/lib/differ/differ_test.rb b/test/lib/differ/differ_test.rb index e947f682..4ff69657 100644 --- a/test/lib/differ/differ_test.rb +++ b/test/lib/differ/differ_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Differ::DifferTest < ActiveSupport::TestCase diff --git a/test/lib/differ/simple_diff_test.rb b/test/lib/differ/simple_diff_test.rb index e6b18b24..8a8f75d9 100644 --- a/test/lib/differ/simple_diff_test.rb +++ b/test/lib/differ/simple_diff_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Differ::SimpleDiffTest < ActiveSupport::TestCase diff --git a/test/lib/file_storage/local_file_test.rb b/test/lib/file_storage/local_file_test.rb index 87cf2535..21092930 100644 --- a/test/lib/file_storage/local_file_test.rb +++ b/test/lib/file_storage/local_file_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class FileStorage::LocalFileTest < ActiveSupport::TestCase diff --git a/test/lib/file_storage/s3_test.rb b/test/lib/file_storage/s3_test.rb index 0a185e89..1eeb151e 100644 --- a/test/lib/file_storage/s3_test.rb +++ b/test/lib/file_storage/s3_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class FileStorage::S3Test < ActiveSupport::TestCase diff --git a/test/lib/good_job_test.rb b/test/lib/good_job_test.rb index e1e19865..5d748db7 100644 --- a/test/lib/good_job_test.rb +++ b/test/lib/good_job_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class GoodJobTest < ActiveSupport::TestCase diff --git a/test/lib/numeric_interval_test.rb b/test/lib/numeric_interval_test.rb index 22d817d1..ab8e25f7 100644 --- a/test/lib/numeric_interval_test.rb +++ b/test/lib/numeric_interval_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class NumericIntervalTest < ActiveSupport::TestCase diff --git a/test/lib/surt/surt_test.rb b/test/lib/surt/surt_test.rb index 12a33e19..b7f768e9 100644 --- a/test/lib/surt/surt_test.rb +++ b/test/lib/surt/surt_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class SurtTest < ActiveSupport::TestCase diff --git a/test/mailers/invitation_mailer_test.rb b/test/mailers/invitation_mailer_test.rb index 86d3ea47..e0c4fafe 100644 --- a/test/mailers/invitation_mailer_test.rb +++ b/test/mailers/invitation_mailer_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class InvitationMailerTest < ActionMailer::TestCase diff --git a/test/models/annotation_test.rb b/test/models/annotation_test.rb index 956f8aec..ef996c29 100644 --- a/test/models/annotation_test.rb +++ b/test/models/annotation_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class AnnotationTest < ActiveSupport::TestCase diff --git a/test/models/application_record_test.rb b/test/models/application_record_test.rb index 487a475b..fb7f4b4d 100644 --- a/test/models/application_record_test.rb +++ b/test/models/application_record_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ApplicationRecordTest < ActiveSupport::TestCase diff --git a/test/models/change_test.rb b/test/models/change_test.rb index 2f536d83..1be77831 100644 --- a/test/models/change_test.rb +++ b/test/models/change_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ChangeTest < ActiveSupport::TestCase diff --git a/test/models/import_test.rb b/test/models/import_test.rb index 57bba88c..4485ab61 100644 --- a/test/models/import_test.rb +++ b/test/models/import_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ImportTest < ActiveSupport::TestCase diff --git a/test/models/invitation_test.rb b/test/models/invitation_test.rb index f90a6ab2..97004c2e 100644 --- a/test/models/invitation_test.rb +++ b/test/models/invitation_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class InvitationTest < ActiveSupport::TestCase diff --git a/test/models/page_test.rb b/test/models/page_test.rb index 45005157..ad25dfce 100644 --- a/test/models/page_test.rb +++ b/test/models/page_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class PageTest < ActiveSupport::TestCase diff --git a/test/models/page_url_test.rb b/test/models/page_url_test.rb index 1fbbb17f..4ae9c384 100644 --- a/test/models/page_url_test.rb +++ b/test/models/page_url_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class PageUrlTest < ActiveSupport::TestCase diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 10049b20..6a580f3b 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class UserTest < ActiveSupport::TestCase diff --git a/test/models/version_test.rb b/test/models/version_test.rb index 6567e260..59de13a6 100644 --- a/test/models/version_test.rb +++ b/test/models/version_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class VersionTest < ActiveSupport::TestCase diff --git a/test/system/users_test.rb b/test/system/users_test.rb index a594980d..58824578 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'application_system_test_case' class UsersTest < ApplicationSystemTestCase diff --git a/test/test_helper.rb b/test/test_helper.rb index 60a478cf..2f2967d4 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../config/environment', __dir__) require 'rails/test_help'