From aa2df2e61de952686a0709348202f9789b1333b8 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 21 Jun 2024 21:58:57 -0400 Subject: [PATCH] Swap standardrb for "the menu"... --- .rubocop.yml | 5 +++++ Gemfile | 2 +- Gemfile.lock | 28 ++++++++++++++-------------- app/helpers/expenses_helper.rb | 2 +- app/helpers/incomes_helper.rb | 2 +- config/environments/development.rb | 4 ++-- config/environments/production.rb | 2 +- config/environments/test.rb | 4 ++-- test/application_system_test_case.rb | 2 +- 9 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..25f5ca5 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,5 @@ +# Omakase Ruby styling for Rails +inherit_gem: + rubocop-rails-omakase: rubocop.yml + +# Your own specialized rules go here diff --git a/Gemfile b/Gemfile index 033ab42..dae4160 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ group :development, :test do end group :development do - gem "standard" + gem "rubocop-rails-omakase", require: false gem "web-console" end diff --git a/Gemfile.lock b/Gemfile.lock index f34018e..91ec0f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,7 +142,6 @@ GEM activesupport (>= 5.0.0) json (2.7.2) language_server-protocol (3.17.0.3) - lint_roller (1.1.0) logger (1.6.0) loofah (2.22.0) crass (~> 1.0.2) @@ -218,9 +217,22 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) + rubocop-minitest (0.35.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails-omakase (1.0.0) + rubocop + rubocop-minitest + rubocop-performance + rubocop-rails ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.10.0) @@ -236,18 +248,6 @@ GEM sprockets (>= 3.0.0) sqlite3 (2.0.2-arm64-darwin) sqlite3 (2.0.2-x86_64-linux-gnu) - standard (1.37.0) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.64.0) - standard-custom (~> 1.0.0) - standard-performance (~> 1.4) - standard-custom (1.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.50) - standard-performance (1.4.0) - lint_roller (~> 1.1) - rubocop-performance (~> 1.21.0) stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.1) @@ -296,10 +296,10 @@ DEPENDENCIES jbuilder puma rails! + rubocop-rails-omakase selenium-webdriver sprockets-rails sqlite3 - standard stimulus-rails tailwindcss-rails (~> 2.0) turbo-rails diff --git a/app/helpers/expenses_helper.rb b/app/helpers/expenses_helper.rb index 739166e..263c8f3 100644 --- a/app/helpers/expenses_helper.rb +++ b/app/helpers/expenses_helper.rb @@ -2,6 +2,6 @@ module ExpensesHelper def expense_periods Expense .periods - .map { |key, value| [key.titleize, Expense.periods.key(value)] } + .map { |key, value| [ key.titleize, Expense.periods.key(value) ] } end end diff --git a/app/helpers/incomes_helper.rb b/app/helpers/incomes_helper.rb index 9d6b84f..8275806 100644 --- a/app/helpers/incomes_helper.rb +++ b/app/helpers/incomes_helper.rb @@ -2,6 +2,6 @@ module IncomesHelper def members Member .all - .map { |member, value| [member.name, member.id] } + .map { |member, value| [ member.name, member.id ] } end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 61c8aa6..d969821 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -24,7 +24,7 @@ Rails.application.configure do config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store - 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 @@ -39,7 +39,7 @@ Rails.application.configure do config.action_mailer.perform_caching = false - config.action_mailer.default_url_options = {host: "localhost", port: 3000} + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/config/environments/production.rb b/config/environments/production.rb index e0ae758..8f42c8c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -60,7 +60,7 @@ Rails.application.configure do .then { |logger| ActiveSupport::TaggedLogging.new(logger) } # Prepend all log lines with the following tags. - config.log_tags = [:request_id] + config.log_tags = [ :request_id ] # "info" includes generic and useful information about system operation, but avoids logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). If you diff --git a/config/environments/test.rb b/config/environments/test.rb index 3064700..83d1fa9 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -18,7 +18,7 @@ Rails.application.configure do 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=#{1.hour.to_i}"} + config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. config.consider_all_requests_local = true @@ -43,7 +43,7 @@ Rails.application.configure do # Unlike controllers, the mailer instance doesn't have any context about the # incoming request so you'll need to provide the :host parameter yourself. - config.action_mailer.default_url_options = {host: "www.example.com"} + config.action_mailer.default_url_options = { host: "www.example.com" } # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 2ac80b6..e2db3a5 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -3,5 +3,5 @@ require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: ENV["VISIBLE_SYSTEM_TESTS"].present? ? :chrome : :headless_chrome, - screen_size: [1400, 1400] + screen_size: [ 1400, 1400 ] end