From 819fd731fd90f82f9d189aa630a62ec9707b8235 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:34:57 +0200 Subject: [PATCH 1/6] Configure rubocop --- .rubocop.yml | 19 +++++++++++++++++++ Gemfile | 2 +- config/application.rb | 2 +- config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- config/environments/test.rb | 2 +- 6 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..005ebfc --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,19 @@ +AllCops: + TargetRubyVersion: 4.0 + NewCops: enable + UseProjectIndex: true + ProjectIndexIncludesGems: true + +# Our `rubocop` rules + +# Style rules + +# Don't allow %i[foo bar baz] +Style/SymbolArray: + Enabled: true + EnforcedStyle: brackets + +# Don't allow %w[foo bar baz] +Style/WordArray: + Enabled: true + EnforcedStyle: brackets diff --git a/Gemfile b/Gemfile index 94a15ea..ed2cd0f 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem "propshaft" gem "puma", ">= 5.0" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem "tzinfo-data", platforms: %i[ windows jruby ] +gem "tzinfo-data", platforms: [ :windows, :jruby ] group :development, :test do gem "rubydex", require: false diff --git a/config/application.rb b/config/application.rb index ae56e4d..da7e7fc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,7 +26,7 @@ class Application < Rails::Application # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w[assets tasks]) + config.autoload_lib(ignore: ['assets', 'tasks']) # Configuration for the application, engines, and railties goes here. # diff --git a/config/environments/development.rb b/config/environments/development.rb index 6f8ff95..243068f 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -20,7 +20,7 @@ if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true - config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = {"cache-control" => "public, max-age=#{2.days.to_i}"} else config.action_controller.perform_caching = false end diff --git a/config/environments/production.rb b/config/environments/production.rb index 20c025c..8ca8a94 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,7 +16,7 @@ config.action_controller.perform_caching = true # Cache assets for far-future expiry since they are all digest stamped. - config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + config.public_file_server.headers = {"cache-control" => "public, max-age=#{1.year.to_i}"} # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" diff --git a/config/environments/test.rb b/config/environments/test.rb index 14bc29e..1a489f5 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -16,7 +16,7 @@ config.eager_load = ENV["CI"].present? # Configure public file server for tests with cache-control for performance. - config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + config.public_file_server.headers = {"cache-control" => "public, max-age=3600"} # Show full error reports. config.consider_all_requests_local = true From 730dffd36f51baff63c471b707547c080f02bcd4 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:36:02 +0200 Subject: [PATCH 2/6] Configure standard --- .standard.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .standard.yml diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..323fdc2 --- /dev/null +++ b/.standard.yml @@ -0,0 +1 @@ +ruby_version: 4.0 From bd55e3776c98f916fe4faa5326e3678c5540df10 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:38:10 +0200 Subject: [PATCH 3/6] Cleanup --- Gemfile | 2 +- config/application.rb | 2 +- config/ci.rb | 2 -- config/environments/production.rb | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index ed2cd0f..792513e 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem "propshaft" gem "puma", ">= 5.0" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem "tzinfo-data", platforms: [ :windows, :jruby ] +gem "tzinfo-data", platforms: [:windows, :jruby] group :development, :test do gem "rubydex", require: false diff --git a/config/application.rb b/config/application.rb index da7e7fc..e8f3818 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,7 +26,7 @@ class Application < Rails::Application # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: ['assets', 'tasks']) + config.autoload_lib(ignore: ["assets", "tasks"]) # Configuration for the application, engines, and railties goes here. # diff --git a/config/ci.rb b/config/ci.rb index 6add09b..e91f8b4 100644 --- a/config/ci.rb +++ b/config/ci.rb @@ -3,8 +3,6 @@ CI.run do step "Setup", "bin/setup --skip-server" - - # Optional: set a green GitHub commit status to unblock PR merge. # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`. # if success? diff --git a/config/environments/production.rb b/config/environments/production.rb index 8ca8a94..dca1a00 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -31,8 +31,8 @@ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } # Log to STDOUT with the current request id as a default log tag. - config.log_tags = [ :request_id ] - config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + config.log_tags = [:request_id] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) # Change to "debug" to log everything (including potentially personally-identifiable information!). config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") From 1d1b41936666038d37bdcb92adc6e089f7b9b484 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:44:19 +0200 Subject: [PATCH 4/6] Cleanup --- .rubocop.yml | 8 ++++++++ Gemfile | 2 ++ Rakefile | 2 ++ app/controllers/application_controller.rb | 2 ++ app/helpers/application_helper.rb | 2 ++ config.ru | 2 ++ config/application.rb | 2 ++ config/boot.rb | 2 ++ config/ci.rb | 2 ++ config/environment.rb | 2 ++ config/environments/development.rb | 2 ++ config/environments/production.rb | 2 ++ config/environments/test.rb | 2 ++ config/initializers/assets.rb | 2 ++ config/initializers/content_security_policy.rb | 2 ++ config/initializers/filter_parameter_logging.rb | 2 ++ config/initializers/inflections.rb | 2 ++ config/initializers/perron.rb | 2 ++ config/puma.rb | 2 ++ config/routes.rb | 2 ++ 20 files changed, 46 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 005ebfc..def26b8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,14 @@ AllCops: NewCops: enable UseProjectIndex: true ProjectIndexIncludesGems: true + Exclude: + - "bin/*" + +# Standard rules. Style: + +# Enforced by `standard`. Disable. +Style/StringLiterals: + Enabled: false # Our `rubocop` rules diff --git a/Gemfile b/Gemfile index 792513e..c6a2aa8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" diff --git a/Rakefile b/Rakefile index 9a5ea73..d2a78aa 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/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d1..7944f9f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..15b06f0 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/config.ru b/config.ru index 4a3c09a..2e03084 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/config/application.rb b/config/application.rb index e8f3818..26c921b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "boot" require "rails" diff --git a/config/boot.rb b/config/boot.rb index 2820116..c2241d7 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/config/ci.rb b/config/ci.rb index e91f8b4..5125ce3 100644 --- a/config/ci.rb +++ b/config/ci.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Run using bin/ci CI.run do diff --git a/config/environment.rb b/config/environment.rb index cac5315..7df99e8 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Load the Rails application. require_relative "application" diff --git a/config/environments/development.rb b/config/environments/development.rb index 243068f..58336f2 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" Rails.application.configure do diff --git a/config/environments/production.rb b/config/environments/production.rb index dca1a00..2239ed3 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" Rails.application.configure do diff --git a/config/environments/test.rb b/config/environments/test.rb index 1a489f5..0e151ba 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 4873244..8544c07 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index d51d713..74b18c5 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy. diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index c0b717f..497ac13 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 3860f65..9e049dc 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/perron.rb b/config/initializers/perron.rb index 30d29d5..e619b27 100644 --- a/config/initializers/perron.rb +++ b/config/initializers/perron.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Perron.configure do |config| # For all options check out: # https://perron.railsdesigner.com/docs/configuration/ diff --git a/config/puma.rb b/config/puma.rb index 1c317b4..4c27d35 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. diff --git a/config/routes.rb b/config/routes.rb index 48254e8..18bbdcf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.application.routes.draw do # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html From 8ccb19872637c8cffb35bb5acd116026a49624fc Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:44:59 +0200 Subject: [PATCH 5/6] Add binstubs --- bin/rdx | 16 ++++++++++++++++ bin/rubocop | 16 ++++++++++++++++ bin/standardrb | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100755 bin/rdx create mode 100755 bin/rubocop create mode 100755 bin/standardrb diff --git a/bin/rdx b/bin/rdx new file mode 100755 index 0000000..0b947be --- /dev/null +++ b/bin/rdx @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rdx' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubydex", "rdx") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..d73598d --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/standardrb b/bin/standardrb new file mode 100755 index 0000000..3b77a15 --- /dev/null +++ b/bin/standardrb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'standardrb' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("standard", "standardrb") From b727c7b9306b4eaa476313f976863a7f7e0aee27 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Wed, 9 Sep 2026 19:47:08 +0200 Subject: [PATCH 6/6] Configure rubocop --- .rubocop.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index def26b8..a5f2335 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,8 +12,19 @@ AllCops: Style/StringLiterals: Enabled: false +# Standard rules. Layout: + +# Enforced by `standard`. Disable. +Layout/SpaceInsideHashLiteralBraces: + Enabled: false + # Our `rubocop` rules +# Bundler rules. + +Bundler/OrderedGems: + Enabled: false + # Style rules # Don't allow %i[foo bar baz] @@ -25,3 +36,7 @@ Style/SymbolArray: Style/WordArray: Enabled: true EnforcedStyle: brackets + +# Disable warnings like "Missing top-level documentation comment for" +Style/Documentation: + Enabled: false