Add Rubocop
This commit is contained in:
parent
2158426d88
commit
c3dba29b8f
|
@ -0,0 +1,18 @@
|
||||||
|
inherit_gem:
|
||||||
|
rubocop-rails-omakase: rubocop.yml
|
||||||
|
|
||||||
|
Style/TrailingCommaInArguments:
|
||||||
|
EnforcedStyleForMultiline: consistent_comma
|
||||||
|
|
||||||
|
Style/TrailingCommaInArrayLiteral:
|
||||||
|
EnforcedStyleForMultiline: consistent_comma
|
||||||
|
|
||||||
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
EnforcedStyleForMultiline: consistent_comma
|
||||||
|
|
||||||
|
Layout/IndentationConsistency:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/IndentationWidth:
|
||||||
|
Enabled: true
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -20,6 +20,7 @@ group :development, :test do
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
gem "rubocop-rails-omakase"
|
||||||
gem "web-console"
|
gem "web-console"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
40
Gemfile.lock
40
Gemfile.lock
|
@ -77,6 +77,7 @@ GEM
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
addressable (2.8.6)
|
addressable (2.8.6)
|
||||||
public_suffix (>= 2.0.2, < 6.0)
|
public_suffix (>= 2.0.2, < 6.0)
|
||||||
|
ast (2.4.2)
|
||||||
base64 (0.2.0)
|
base64 (0.2.0)
|
||||||
bcrypt (3.1.20)
|
bcrypt (3.1.20)
|
||||||
bigdecimal (3.1.7)
|
bigdecimal (3.1.7)
|
||||||
|
@ -117,6 +118,8 @@ GEM
|
||||||
jbuilder (2.11.5)
|
jbuilder (2.11.5)
|
||||||
actionview (>= 5.0.0)
|
actionview (>= 5.0.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
|
json (2.7.2)
|
||||||
|
language_server-protocol (3.17.0.3)
|
||||||
loofah (2.22.0)
|
loofah (2.22.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.12.0)
|
nokogiri (>= 1.12.0)
|
||||||
|
@ -153,6 +156,10 @@ GEM
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.4-x86_64-linux)
|
nokogiri (1.16.4-x86_64-linux)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
|
parallel (1.24.0)
|
||||||
|
parser (3.3.0.5)
|
||||||
|
ast (~> 2.4.1)
|
||||||
|
racc
|
||||||
pg (1.5.6)
|
pg (1.5.6)
|
||||||
psych (5.1.2)
|
psych (5.1.2)
|
||||||
stringio
|
stringio
|
||||||
|
@ -197,6 +204,7 @@ GEM
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0, >= 1.2.2)
|
thor (~> 1.0, >= 1.2.2)
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
|
rainbow (3.1.1)
|
||||||
rake (13.2.1)
|
rake (13.2.1)
|
||||||
rdoc (6.6.3.1)
|
rdoc (6.6.3.1)
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
|
@ -204,6 +212,36 @@ GEM
|
||||||
reline (0.5.1)
|
reline (0.5.1)
|
||||||
io-console (~> 0.5)
|
io-console (~> 0.5)
|
||||||
rexml (3.2.6)
|
rexml (3.2.6)
|
||||||
|
rubocop (1.63.1)
|
||||||
|
json (~> 2.3)
|
||||||
|
language_server-protocol (>= 3.17.0)
|
||||||
|
parallel (~> 1.10)
|
||||||
|
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.31.1, < 2.0)
|
||||||
|
ruby-progressbar (~> 1.7)
|
||||||
|
unicode-display_width (>= 2.4.0, < 3.0)
|
||||||
|
rubocop-ast (1.31.2)
|
||||||
|
parser (>= 3.3.0.4)
|
||||||
|
rubocop-minitest (0.35.0)
|
||||||
|
rubocop (>= 1.61, < 2.0)
|
||||||
|
rubocop-ast (>= 1.31.1, < 2.0)
|
||||||
|
rubocop-performance (1.21.0)
|
||||||
|
rubocop (>= 1.48.1, < 2.0)
|
||||||
|
rubocop-ast (>= 1.31.1, < 2.0)
|
||||||
|
rubocop-rails (2.24.1)
|
||||||
|
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)
|
rubyzip (2.3.2)
|
||||||
selenium-webdriver (4.19.0)
|
selenium-webdriver (4.19.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
|
@ -228,6 +266,7 @@ GEM
|
||||||
railties (>= 6.0.0)
|
railties (>= 6.0.0)
|
||||||
tzinfo (2.0.6)
|
tzinfo (2.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
|
unicode-display_width (2.5.0)
|
||||||
web-console (4.2.1)
|
web-console (4.2.1)
|
||||||
actionview (>= 6.0.0)
|
actionview (>= 6.0.0)
|
||||||
activemodel (>= 6.0.0)
|
activemodel (>= 6.0.0)
|
||||||
|
@ -260,6 +299,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
puma (>= 5.0)
|
puma (>= 5.0)
|
||||||
rails (~> 7.1.3, >= 7.1.3.2)
|
rails (~> 7.1.3, >= 7.1.3.2)
|
||||||
|
rubocop-rails-omakase
|
||||||
selenium-webdriver
|
selenium-webdriver
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
stimulus-rails
|
stimulus-rails
|
||||||
|
|
|
@ -14,7 +14,8 @@ class User < ApplicationRecord
|
||||||
uniqueness: true,
|
uniqueness: true,
|
||||||
length: { minimum: 5, maximum: 100 },
|
length: { minimum: 5, maximum: 100 },
|
||||||
format: { with: URI::MailTo::EMAIL_REGEXP,
|
format: { with: URI::MailTo::EMAIL_REGEXP,
|
||||||
message: "must be a valid email address" }
|
message: "must be a valid email address",
|
||||||
|
}
|
||||||
normalizes :email, with: ->(email) { email.strip.downcase }
|
normalizes :email, with: ->(email) { email.strip.downcase }
|
||||||
validates :first_name,
|
validates :first_name,
|
||||||
presence: true,
|
presence: true,
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Forg
|
||||||
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
# 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.
|
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
||||||
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
||||||
config.autoload_lib(ignore: %w(assets tasks))
|
config.autoload_lib(ignore: %w[assets tasks])
|
||||||
|
|
||||||
# Configuration for the application, engines, and railties goes here.
|
# Configuration for the application, engines, and railties goes here.
|
||||||
#
|
#
|
||||||
|
|
|
@ -25,7 +25,7 @@ Rails.application.configure do
|
||||||
|
|
||||||
config.cache_store = :memory_store
|
config.cache_store = :memory_store
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
"Cache-Control" => "public, max-age=#{2.days.to_i}",
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
|
@ -20,7 +20,7 @@ Rails.application.configure do
|
||||||
# Configure public file server for tests with Cache-Control for performance.
|
# Configure public file server for tests with Cache-Control for performance.
|
||||||
config.public_file_server.enabled = true
|
config.public_file_server.enabled = true
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
"Cache-Control" => "public, max-age=#{1.hour.to_i}",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
# Use this to limit dissemination of sensitive information.
|
# Use this to limit dissemination of sensitive information.
|
||||||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
||||||
Rails.application.config.filter_parameters += [
|
Rails.application.config.filter_parameters += [
|
||||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn,
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||||
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
|
driven_by :selenium, using: :chrome, screen_size: [ 1400, 1400 ]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue