Skip to content

Commit

Permalink
Merge pull request #653 from artsy/jonallured/chore-switch-to-standar…
Browse files Browse the repository at this point in the history
…d-ruby

chore: Switch to Standard Ruby
  • Loading branch information
jonallured authored Oct 9, 2024
2 parents defb195 + 2bf4fda commit 1bd0fe4
Show file tree
Hide file tree
Showing 73 changed files with 781 additions and 762 deletions.
11 changes: 0 additions & 11 deletions .rubocop.yml

This file was deleted.

1 change: 1 addition & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
format: progress
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 14.17.6
ruby 3.0.2
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"shopify.ruby-lsp",
"testdouble.vscode-standard-ruby"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"[ruby]": {
"editor.defaultFormatter": "testdouble.vscode-standard-ruby"
},
}
56 changes: 28 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# frozen_string_literal: true

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

ruby '3.0.2'
ruby "3.0.2"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'coffee-rails'
gem 'dogstatsd-ruby', require: 'datadog/statsd' # send metrics to datadog agent
gem 'rails', '~> 6.1.7.7'
gem "coffee-rails"
gem "dogstatsd-ruby", require: "datadog/statsd" # send metrics to datadog agent
gem "rails", "~> 6.1.7.7"
# Use postgresql as the database for Active Record
gem 'pg'
gem "pg"
# Use Puma as the app server
gem 'puma', '~> 5.6'
gem "puma", "~> 5.6"
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem "sass-rails", "~> 5.0"
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
gem "uglifier", ">= 1.3.0"
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby

# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
# gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem "jbuilder", "~> 2.5"
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
Expand All @@ -38,36 +38,36 @@ gem 'jbuilder', '~> 2.5'
# Reduces boot times through caching; required in config/boot.rb
# gem 'bootsnap', '>= 1.1.0', require: false

gem 'activeadmin' # manage models
gem 'active_admin_datetimepicker'
gem 'acts_as_list' # order Project#stages
gem 'lograge'
gem 'octokit', '~> 4.0' # talk to github api
gem 'redis' # actioncable adapter
gem 'releasecop', '>= 0.0.15' # compare release stages
gem 'semantic'
gem "activeadmin" # manage models
gem "active_admin_datetimepicker"
gem "acts_as_list" # order Project#stages
gem "lograge"
gem "octokit", "~> 4.0" # talk to github api
gem "redis" # actioncable adapter
gem "releasecop", ">= 0.0.15" # compare release stages
gem "semantic"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'rspec-rails' # tests!
gem 'rubocop', require: false
gem "byebug", platforms: %i[mri mingw x64_mingw]
gem "rspec-rails" # tests!
gem "standard"
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen'
gem 'web-console', '>= 3.3.0'
gem "listen"
gem "web-console", ">= 3.3.0"
end

group :test do
gem 'capybara' # feature specs
gem 'webmock' # stub HTTP requests
gem "capybara" # feature specs
gem "webmock" # stub HTTP requests
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]

gem 'webpacker', '~> 5.4'
gem "webpacker", "~> 5.4"

gem 'fugit'
gem "fugit"
44 changes: 31 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.6.3)
json (2.7.2)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -153,6 +153,8 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -191,9 +193,10 @@ GEM
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
parallel (1.22.1)
parser (3.2.0.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.4.2)
public_suffix (4.0.7)
puma (5.6.9)
Expand Down Expand Up @@ -270,19 +273,22 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.44.1)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -307,6 +313,18 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
standard (1.41.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.66.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.5)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.5.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.22.0)
strscan (3.1.0)
thor (1.3.1)
tilt (2.0.11)
Expand All @@ -315,7 +333,7 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.4.2)
unicode-display_width (2.6.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -359,9 +377,9 @@ DEPENDENCIES
redis
releasecop (>= 0.0.15)
rspec-rails
rubocop
sass-rails (~> 5.0)
semantic
standard
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
Expand Down
23 changes: 8 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# 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.

require_relative 'config/application'
require_relative "config/application"

Rails.application.load_tasks

Expand All @@ -20,22 +17,18 @@ namespace :cron do
end

if Rails.env.development? || Rails.env.test?
require 'rubocop/rake_task'
desc 'Run RuboCop'
RuboCop::RakeTask.new(:rubocop)

desc 'run prettier'
desc "run prettier"
task prettier: :environment do
system 'yarn prettier'
abort 'prettier failed' unless $CHILD_STATUS.exitstatus.zero?
system "yarn prettier"
abort "prettier failed" unless $CHILD_STATUS.exitstatus.zero?
end

desc 'run jest'
desc "run jest"
task jest: :environment do
system 'yarn test --runInBand'
abort 'jest failed' unless $CHILD_STATUS.exitstatus.zero?
system "yarn test --runInBand"
abort "jest failed" unless $CHILD_STATUS.exitstatus.zero?
end

Rake::Task[:default].clear
task default: %i[rubocop prettier jest spec]
task default: %i[standard prettier jest spec]
end
14 changes: 7 additions & 7 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# frozen_string_literal: true

ActiveAdmin.register_page 'Dashboard' do
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }
ActiveAdmin.register_page "Dashboard" do
menu priority: 1, label: proc { I18n.t("active_admin.dashboard") }

content title: proc { I18n.t('active_admin.dashboard') } do
div class: 'blank_slate_container', id: 'dashboard_default_message' do
span class: 'blank_slate' do
span I18n.t('active_admin.dashboard_welcome.welcome')
small I18n.t('active_admin.dashboard_welcome.call_to_action')
content title: proc { I18n.t("active_admin.dashboard") } do
div class: "blank_slate_container", id: "dashboard_default_message" do
span class: "blank_slate" do
span I18n.t("active_admin.dashboard_welcome.welcome")
small I18n.t("active_admin.dashboard_welcome.call_to_action")
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/admin/deploy_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
input(
:resolved_at,
as: :date_time_picker,
datepicker_options: { formatTime: 'g:ia' },
label: 'Resolved At (TZ: Eastern Time)'
datepicker_options: {formatTime: "g:ia"},
label: "Resolved At (TZ: Eastern Time)"
)
input :description
end
Expand Down
4 changes: 2 additions & 2 deletions app/admin/deploy_strategies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
f.input :profile
f.input :automatic
f.input :arguments_input,
label: 'Arguments (JSON)',
hint: 'Supported properties: base (branch), head (branch), repo (e.g., org/project), merge_after (sec.),
label: "Arguments (JSON)",
hint: 'Supported properties: base (branch), head (branch), repo (e.g., org/project), merge_after (sec.),
merge_prior_warning (sec., default 3600), slack_webhook_url, warned_pull_request_url,
blocked_time_buckets'
end
Expand Down
2 changes: 1 addition & 1 deletion app/admin/profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def update
f.input :organization
f.input :basic_username
f.input :basic_password
f.input :environment_input, as: :text, label: 'Environment'
f.input :environment_input, as: :text, label: "Environment"
end
f.actions
end
Expand Down
8 changes: 4 additions & 4 deletions app/admin/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end
sidebar 'Associated Data', only: %i[show edit] do
sidebar "Associated Data", only: %i[show edit] do
ul do
li link_to 'Stages', admin_project_stages_path(project)
li link_to 'Deploy Blocks', admin_deploy_blocks_path(q: { project_id_eq: project.id })
li link_to "Stages", admin_project_stages_path(project)
li link_to "Deploy Blocks", admin_deploy_blocks_path(q: {project_id_eq: project.id})
end
end

Expand All @@ -28,7 +28,7 @@
f.input :organization
f.input :name
f.input :description
f.input :tags_input, label: 'Tags (JSON array)'
f.input :tags_input, label: "Tags (JSON array)"
f.input :criticality, as: :select, collection: [0, 1, 2, 3]
end
f.actions
Expand Down
4 changes: 2 additions & 2 deletions app/admin/stages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# end
belongs_to :project

sidebar 'Associated Data', only: %i[show edit] do
sidebar "Associated Data", only: %i[show edit] do
ul do
li link_to 'Deploy Strategies', admin_stage_deploy_strategies_path(stage)
li link_to "Deploy Strategies", admin_stage_deploy_strategies_path(stage)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def admin_basic_auth
end

def set_admin_timezone
Time.zone = 'Eastern Time (US & Canada)'
Time.zone = "Eastern Time (US & Canada)"
end
end
4 changes: 2 additions & 2 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class ApplicationMailer < ActionMailer::Base
default from: '[email protected]'
layout 'mailer'
default from: "[email protected]"
layout "mailer"
end
4 changes: 2 additions & 2 deletions app/models/comparison.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class Comparison < ApplicationRecord
belongs_to :snapshot
belongs_to :ahead_stage, class_name: 'Stage'
belongs_to :behind_stage, class_name: 'Stage'
belongs_to :ahead_stage, class_name: "Stage"
belongs_to :behind_stage, class_name: "Stage"

acts_as_list scope: :snapshot

Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/jsonb_editable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module JsonbEditable

class_methods do
def jsonb_editable(field_name, as: "#{field_name}_input")
define_method("#{as}=") do |val|
send("#{field_name}=", val.presence && JSON.parse(val))
define_method(:"#{as}=") do |val|
send(:"#{field_name}=", val.presence && JSON.parse(val))
end

define_method(as) do
Expand Down
Loading

0 comments on commit 1bd0fe4

Please sign in to comment.