Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ linters:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
DeprecatedClasses:
enabled: true
rule_set:
Expand Down
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,16 @@ Style/For:
Enabled: true
EnforcedStyle: each

Style/FrozenStringLiteralComment:
Enabled: true
Exclude:
- 'spec/**/*.rb'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be any similar benefit to extending this to spec files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm speculating, but I'd guess no. It can be helpful to freeze strings for performance purposes, but the impact is usually smaller, so I'm not sure how big of an impact it would have on tests.

- '.irbrc'
- '.rubocop.yml'
- 'Brewfile'
- 'Gemfile'
- 'Rakefile'

Style/GlobalVars:
Enabled: true
AllowedVariables: []
Expand Down
2 changes: 2 additions & 0 deletions app/components/accordion_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AccordionComponent < BaseComponent
renders_one :header

Expand Down
2 changes: 2 additions & 0 deletions app/components/alert_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AlertComponent < BaseComponent
VALID_TYPES = %i[info success warning error emergency other].freeze

Expand Down
2 changes: 2 additions & 0 deletions app/components/alert_icon_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AlertIconComponent < BaseComponent
ICON_SOURCE = {
warning: 'status/warning.svg',
Expand Down
2 changes: 2 additions & 0 deletions app/components/badge_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class BadgeComponent < BaseComponent
ICONS = %i[
unphishable
Expand Down
2 changes: 2 additions & 0 deletions app/components/barcode_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'barby'
require 'barby/barcode/code_128'
require 'barby/outputter/html_outputter'
Expand Down
2 changes: 2 additions & 0 deletions app/components/base_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class BaseComponent < ViewComponent::Base
def before_render
render_assets unless rendered_assets?
Expand Down
2 changes: 2 additions & 0 deletions app/components/block_link_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class BlockLinkComponent < BaseComponent
attr_reader :url, :action, :new_tab, :tag_options, :component

Expand Down
2 changes: 2 additions & 0 deletions app/components/button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ButtonComponent < BaseComponent
attr_reader :action, :icon, :big, :wide, :full_width, :outline, :unstyled, :danger, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/captcha_submit_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CaptchaSubmitButtonComponent < BaseComponent
attr_reader :form, :action, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/click_observer_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ClickObserverComponent < BaseComponent
attr_reader :event_name, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/clipboard_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ClipboardButtonComponent < BaseComponent
attr_reader :clipboard_text, :button_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/countdown_alert_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CountdownAlertComponent < BaseComponent
attr_reader :show_at_remaining, :alert_options, :countdown_options, :redirect_url, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/countdown_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CountdownComponent < BaseComponent
attr_reader :expiration, :update_interval, :start_immediately, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/download_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DownloadButtonComponent < ButtonComponent
attr_reader :file_data, :file_name, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/flash_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FlashComponent < BaseComponent
VALID_FLASH_TYPES = %w[error info success warning other notice alert].freeze

Expand Down
2 changes: 2 additions & 0 deletions app/components/form_link_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FormLinkComponent < BaseComponent
attr_reader :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/icon_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class IconComponent < BaseComponent
# See: https://github.com/uswds/uswds/tree/develop/src/img/usa-icons
ICONS = %i[
Expand Down
2 changes: 2 additions & 0 deletions app/components/icon_list_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class IconListComponent < BaseComponent
renders_many :items, ->(**kwargs, &block) do
IconListItemComponent.new(icon:, color:, **kwargs, &block)
Expand Down
2 changes: 2 additions & 0 deletions app/components/javascript_required_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class JavascriptRequiredComponent < BaseComponent
include LinkHelper

Expand Down
2 changes: 2 additions & 0 deletions app/components/login_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class LoginButtonComponent < BaseComponent
VALID_COLORS = ['primary', 'primary-darker', 'primary-lighter'].freeze

Expand Down
2 changes: 2 additions & 0 deletions app/components/manageable_authenticator_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ManageableAuthenticatorComponent < BaseComponent
attr_reader :configuration,
:user_session,
Expand Down
2 changes: 2 additions & 0 deletions app/components/memorable_date_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

##
# Provides a component that accepts a date using the inputs specified
# by USWDS here: https://designsystem.digital.gov/components/memorable-date/
Expand Down
2 changes: 2 additions & 0 deletions app/components/modal_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ModalComponent < BaseComponent
attr_reader :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/one_time_code_input_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class OneTimeCodeInputComponent < BaseComponent
attr_reader :form,
:name,
Expand Down
2 changes: 2 additions & 0 deletions app/components/page_footer_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PageFooterComponent < BaseComponent
attr_reader :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/page_heading_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PageHeadingComponent < BaseComponent
attr_reader :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/password_confirmation_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PasswordConfirmationComponent < BaseComponent
attr_reader :form, :field_options, :forbidden_passwords, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/password_strength_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PasswordStrengthComponent < BaseComponent
attr_reader :input_id, :forbidden_passwords, :minimum_length, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/password_toggle_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PasswordToggleComponent < BaseComponent
attr_reader :form, :field_options, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/phone_input_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PhoneInputComponent < BaseComponent
attr_reader :form,
:confirmed_phone,
Expand Down
2 changes: 2 additions & 0 deletions app/components/print_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PrintButtonComponent < ButtonComponent
attr_reader :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/process_list_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ProcessListComponent < BaseComponent
renders_many :items, ->(**kwargs, &block) do
ProcessListItemComponent.new(heading_level:, **kwargs, &block)
Expand Down
2 changes: 2 additions & 0 deletions app/components/spinner_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class SpinnerButtonComponent < BaseComponent
DEFAULT_LONG_WAIT_DURATION = 15.seconds

Expand Down
2 changes: 2 additions & 0 deletions app/components/status_page_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StatusPageComponent < BaseComponent
ICONS = {
info: [:question],
Expand Down
2 changes: 2 additions & 0 deletions app/components/step_indicator_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StepIndicatorComponent < BaseComponent
attr_reader :current_step, :locale_scope, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/step_indicator_step_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StepIndicatorStepComponent < BaseComponent
attr_reader :title, :status, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/submit_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class SubmitButtonComponent < ButtonComponent
def initialize(big: true, wide: true, **tag_options)
super(big:, wide:, **tag_options)
Expand Down
2 changes: 2 additions & 0 deletions app/components/tab_navigation_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class TabNavigationComponent < BaseComponent
attr_reader :label, :routes, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/tag_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class TagComponent < BaseComponent
attr_reader :big, :informative, :tag_options
alias_method :big?, :big
Expand Down
2 changes: 2 additions & 0 deletions app/components/time_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class TimeComponent < BaseComponent
attr_reader :time, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/troubleshooting_options_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class TroubleshootingOptionsComponent < BaseComponent
renders_one :header, 'TroubleshootingOptionsHeadingComponent'
renders_many :options, BlockLinkComponent
Expand Down
2 changes: 2 additions & 0 deletions app/components/validated_field_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ValidatedFieldComponent < BaseComponent
attr_reader :form, :name, :tag_options, :input_type

Expand Down
2 changes: 2 additions & 0 deletions app/components/vendor_outage_alert_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class VendorOutageAlertComponent < BaseComponent
include LinkHelper

Expand Down
2 changes: 2 additions & 0 deletions app/components/webauthn_input_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class WebauthnInputComponent < BaseComponent
attr_reader :platform, :passkey_supported_only, :show_unsupported_passkey, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/components/webauthn_verify_button_component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class WebauthnVerifyButtonComponent < BaseComponent
attr_reader :credentials, :user_challenge, :tag_options

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/cancel_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class CancelController < ApplicationController
def show
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class ConfirmDeleteAccountController < ApplicationController
def show
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/confirm_request_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class ConfirmRequestController < ApplicationController
def show
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/delete_account_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class DeleteAccountController < ApplicationController
def show
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/pending_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class PendingController < ApplicationController
include UserAuthenticator
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/recovery_options_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class RecoveryOptionsController < ApplicationController
include TwoFactorAuthenticatable
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/account_reset/request_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AccountReset
class RequestController < ApplicationController
include TwoFactorAuthenticatable
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/accounts/connected_accounts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Accounts
class ConnectedAccountsController < ApplicationController
include RememberDeviceConcern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/accounts/history_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Accounts
class HistoryController < ApplicationController
include RememberDeviceConcern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/accounts/personal_keys_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Accounts
# Lets users generate a new personal key
class PersonalKeysController < ApplicationController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Accounts
class TwoFactorAuthenticationController < ApplicationController
include RememberDeviceConcern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AccountsController < ApplicationController
include RememberDeviceConcern
before_action :confirm_two_factor_authenticated
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/analytics_events_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Serve a static file from Rails so that the CORS middleware can add the correct headers
class AnalyticsEventsController < ApplicationController
prepend_before_action :skip_session_load
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/internal/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Api
module Internal
class SessionsController < ApplicationController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Api
module Internal
module TwoFactorAuthentication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Api
module Internal
module TwoFactorAuthentication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Api
module Internal
module TwoFactorAuthentication
Expand Down
Loading