From a2890624c6ec09228b00db26e118bd815ab85241 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 14 Nov 2020 00:30:18 -1000 Subject: [PATCH] Rubocop and gem specification cleanups --- .rubocop.yml | 134 ++------------ Gemfile | 34 +--- Gemfile.development_dependencies | 54 ++++++ README.md | 1 + docs/tutorial.md | 2 +- lib/react_on_rails/git_utils.rb | 6 +- .../ruby_embedded_java_script.rb | 8 +- .../test_helper/webpack_assets_compiler.rb | 2 +- lib/react_on_rails/utils.rb | 4 +- lib/tasks/assets.rake | 8 +- rakelib/docker.rake | 5 - rakelib/lint.rake | 12 +- rakelib/task_helpers.rb | 5 +- react_on_rails.gemspec | 22 +-- ruby-lint.yml | 25 --- spec/dummy/.rubocop.yml | 16 ++ spec/dummy/Gemfile | 73 +------- spec/dummy/Gemfile.lock | 165 ++++++++---------- spec/dummy/app/assets/config/manifest.js | 2 + spec/dummy/db/schema.rb | 2 + spec/{ => dummy/spec}/.rubocop.yml | 2 +- spec/react_on_rails/.rubocop.yml | 5 + spec/react_on_rails/configuration_spec.rb | 2 + 23 files changed, 200 insertions(+), 389 deletions(-) create mode 100644 Gemfile.development_dependencies delete mode 100644 ruby-lint.yml create mode 100644 spec/dummy/.rubocop.yml create mode 100644 spec/dummy/app/assets/config/manifest.js rename spec/{ => dummy/spec}/.rubocop.yml (83%) create mode 100644 spec/react_on_rails/.rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml index 6d44e0976e..5580ab6a09 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ # Check out: https://github.com/bbatsov/rubocop AllCops: + NewCops: enable DisplayCopNames: true TargetRubyVersion: 2.5 @@ -13,35 +14,32 @@ AllCops: - '**/*.rake' Exclude: - - 'vendor/**/*' - - 'spec/fixtures/**/*' - - 'node_modules/**/.*' - - 'node_modules/**/*' + <% `git status --ignored --porcelain`.lines.grep(/^!! /).each do |path| %> + - <%= path.sub(/^!! /, '') %> + <% end %> + - '**/*.js' + - '**/log/**/*' + - '**/node_modules/**/*' + - '**/public/**/*' + - '**/tmp/**/*' + - '.git/**/*' + - 'bin/**/*' - 'coverage/**/*' - 'db/**/*' - 'db/schema.rb' - 'db/seeds.rb' - - 'client/node_modules/**/*.*' - - 'client/node_modules/**/.*' - - 'bin/**/*' - - !ruby/regexp /old_and_unused\.rb$/ - - 'spec/react_on_rails/dummy-for-generators/**/*' - - 'spec/dummy/Procfile.*' - - 'spec/dummy/bin/**/*' - - 'spec/dummy/node_modules/**/*' - - 'spec/dummy/node_modules/**/.*' - - 'gen-examples/examples/**/.*' - 'gen-examples/examples/**/*' + - 'node_modules/**/*' + - 'spec/fixtures/**/*' + - 'spec/react_on_rails/dummy-for-generators/**/*' + - 'tmp/**/*' + - 'vendor/**/*' Naming/FileName: Exclude: - 'Gemfile' - 'spec/dummy/Gemfile' -# Turn off until we require 2.3 ruby -Style/SafeNavigation: - Enabled: false - Layout/LineLength: Max: 120 @@ -97,103 +95,3 @@ Naming/RescuedExceptionsVariableName: Style/GlobalVars: Exclude: - 'spec/dummy/config/environments/development.rb' - -Style/FrozenStringLiteralComment: - EnforcedStyle: always - -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: true - -Layout/SpaceAroundMethodCallOperator: - Enabled: true - -Lint/RaiseException: - Enabled: true - -Lint/StructNewOverride: - Enabled: true - -Style/ExponentialNotation: - Enabled: true - -Style/SlicingWithRange: - Enabled: true - -Layout/BeginEndAlignment: # (new in 0.91) - Enabled: true -Lint/BinaryOperatorWithIdenticalOperands: # (new in 0.89) - Enabled: true -Lint/ConstantDefinitionInBlock: # (new in 0.91) - Enabled: true -Lint/DeprecatedOpenSSLConstant: # (new in 0.84) - Enabled: true -Lint/DuplicateElsifCondition: # (new in 0.88) - Enabled: true -Lint/DuplicateRequire: # (new in 0.90) - Enabled: true -Lint/DuplicateRescueException: # (new in 0.89) - Enabled: true -Lint/EmptyConditionalBody: # (new in 0.89) - Enabled: true -Lint/EmptyFile: # (new in 0.90) - Enabled: true -Lint/FloatComparison: # (new in 0.89) - Enabled: true -Lint/IdentityComparison: # (new in 0.91) - Enabled: true -Lint/MissingSuper: # (new in 0.89) - Enabled: true -Lint/MixedRegexpCaptureTypes: # (new in 0.85) - Enabled: true -Lint/OutOfRangeRegexpRef: # (new in 0.89) - Enabled: true -Lint/SelfAssignment: # (new in 0.89) - Enabled: true -Lint/TopLevelReturnWithArgument: # (new in 0.89) - Enabled: true -Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90) - Enabled: true -Lint/UnreachableLoop: # (new in 0.89) - Enabled: true -Lint/UselessMethodDefinition: # (new in 0.90) - Enabled: true -Lint/UselessTimes: # (new in 0.91) - Enabled: true -Style/AccessorGrouping: # (new in 0.87) - Enabled: true -Style/BisectedAttrAccessor: # (new in 0.87) - Enabled: true -Style/CaseLikeIf: # (new in 0.88) - Enabled: true -Style/CombinableLoops: # (new in 0.90) - Enabled: true -Style/ExplicitBlockArgument: # (new in 0.89) - Enabled: true -Style/GlobalStdStream: # (new in 0.89) - Enabled: true -Style/HashAsLastArrayItem: # (new in 0.88) - Enabled: true -Style/HashLikeCase: # (new in 0.88) - Enabled: true -Style/KeywordParametersOrder: # (new in 0.90) - Enabled: true -Style/OptionalBooleanParameter: # (new in 0.89) - Enabled: true -Style/RedundantAssignment: # (new in 0.87) - Enabled: true -Style/RedundantFetchBlock: # (new in 0.86) - Enabled: true -Style/RedundantFileExtensionInRequire: # (new in 0.88) - Enabled: true -Style/RedundantRegexpCharacterClass: # (new in 0.85) - Enabled: true -Style/RedundantRegexpEscape: # (new in 0.85) - Enabled: true -Style/RedundantSelfAssignment: # (new in 0.90) - Enabled: true -Style/SingleArgumentDig: # (new in 0.89) - Enabled: true -Style/SoleNestedConditional: # (new in 0.89) - Enabled: true -Style/StringConcatenation: # (new in 0.89) - Enabled: true diff --git a/Gemfile b/Gemfile index f35845c159..18a965c646 100644 --- a/Gemfile +++ b/Gemfile @@ -5,36 +5,4 @@ source "https://rubygems.org" # Specify your gem"s dependencies in react_on_rails.gemspec gemspec -# The following gems are dependencies of the gem's dummy/example apps, not the gem itself. -# They must be defined here because of the way Travis CI works, in that it will only -# bundle install from a single Gemfile. Therefore, all gems that we will need for any dummy/example -# app have to be manually added to this file. -gem "bootsnap", ">= 1.1.0", require: false -gem "bootstrap-sass" -gem "jbuilder" -gem "jquery-rails" -gem "mini_racer" -gem "puma" -gem "rails_12factor" -gem "ruby-lint", require: false -gem "sass-rails" -gem "scss_lint", require: false -gem "sdoc", group: :doc -gem "spring" -gem "sprockets", "~>3.0" -gem "sqlite3", "~> 1.4" -gem "turbolinks" -gem "uglifier" -gem "web-console", group: :development - -# below are copied from spec/dummy/Gemfile -gem "capybara" -gem "capybara-screenshot" -gem "launchy" -gem "rspec-rails" -gem "rspec-retry" -gem "selenium-webdriver" -gem "webpacker", ">= 5.2.1" - -gem "equivalent-xml", github: "mbklein/equivalent-xml" -gem "rainbow" +eval_gemfile File.expand_path("./Gemfile.development_dependencies", __dir__) diff --git a/Gemfile.development_dependencies b/Gemfile.development_dependencies new file mode 100644 index 0000000000..b1ef8705ad --- /dev/null +++ b/Gemfile.development_dependencies @@ -0,0 +1,54 @@ +# frozen_string_literal: true + + +# We'll revert this before the final merge. +# gem "webpacker", git: 'https://github.com/rails/webpacker.git' +gem "webpacker" +gem "bootsnap", ">= 1.1.0", require: false +gem "rails" +gem "sqlite3" +gem "sass-rails" +gem "uglifier" +gem "jquery-rails" +gem "puma" + +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem "turbolinks" if ENV["DISABLE_TURBOLINKS"].nil? || ENV["DISABLE_TURBOLINKS"].strip.empty? + +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem "jbuilder" +# bundle exec rake doc:rails generates the API under doc/api. +gem "sdoc", group: :doc + +gem "sprockets" + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development +gem "awesome_print" +gem "mini_racer" + +group :development, :test do + gem "listen" + gem "pry" + gem "pry-byebug" + gem "pry-doc" + gem "pry-rails" + gem "pry-rescue" + gem "rubocop", "1.2.0", require: false + gem "scss_lint", require: false + gem "spring" +end + +group :test do + gem "capybara" + gem "capybara-screenshot" + gem "coveralls", require: false + gem "equivalent-xml" + gem "generator_spec" + gem "launchy" + gem "rspec_junit_formatter" + gem "rspec-rails" + gem "rspec-retry" + gem "selenium-webdriver" + gem "webdrivers", "~> 3.0" +end diff --git a/README.md b/README.md index 3ddc2b052c..eb27c000f0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ *These are the docs for React on Rails 12. To see the version 11 docs, [click here](https://github.com/shakacode/react_on_rails/tree/11.3.0).* #### News + **October 14, 2020**: [RUBY ROGUES RR 474: React on Rails V12 – Don’t Shave That Yak! with Justin Gordon](https://devchat.tv/ruby-rogues/rr-474-react-on-rails-v12-dont-shave-that-yak-with-justin-gordon/). diff --git a/docs/tutorial.md b/docs/tutorial.md index ebf3be7e5c..e31ff98f34 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -2,7 +2,7 @@ ----- -**August 2, 2020**: See the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh) for a new way to setup the creation of your SSR bundle with `rails/webpacker`. This file will be update shortly. Most of it is still relevant. +**November 11, 2020**: See the example repo of [React on Rails Tutorial With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh) for a new way to setup the creation of your SSR bundle with `rails/webpacker`. This file will be update shortly. Most of it is still relevant. ----- diff --git a/lib/react_on_rails/git_utils.rb b/lib/react_on_rails/git_utils.rb index 95899cd385..82a0c198fb 100644 --- a/lib/react_on_rails/git_utils.rb +++ b/lib/react_on_rails/git_utils.rb @@ -10,10 +10,10 @@ def self.uncommitted_changes?(message_handler) status = `git status --porcelain` return false if $CHILD_STATUS.success? && status.empty? - error = if !$CHILD_STATUS.success? - "You do not have Git installed. Please install Git, and commit your changes before continuing" - else + error = if $CHILD_STATUS.success? "You have uncommitted code. Please commit or stash your changes before continuing" + else + "You do not have Git installed. Please install Git, and commit your changes before continuing" end message_handler.add_error(error) true diff --git a/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb b/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb index 7d29ce2c3c..8910bf926e 100644 --- a/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +++ b/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb @@ -69,11 +69,9 @@ def exec_server_render_js(js_code, render_options, js_evaluator = nil) console_script_lines = console_script.split("\n") console_script_lines = console_script_lines[2..-2] re = /console\.(?:log|error)\.apply\(console, \["\[SERVER\] (?.*)"\]\);/ - if console_script_lines - console_script_lines.each do |line| - match = re.match(line) - Rails.logger.info { "[react_on_rails] #{match[:msg]}" } if match - end + console_script_lines&.each do |line| + match = re.match(line) + Rails.logger.info { "[react_on_rails] #{match[:msg]}" } if match end end result diff --git a/lib/react_on_rails/test_helper/webpack_assets_compiler.rb b/lib/react_on_rails/test_helper/webpack_assets_compiler.rb index 644a533b6f..3da9e0fc3e 100644 --- a/lib/react_on_rails/test_helper/webpack_assets_compiler.rb +++ b/lib/react_on_rails/test_helper/webpack_assets_compiler.rb @@ -8,7 +8,7 @@ class WebpackAssetsCompiler def compile_assets if ReactOnRails.configuration.build_test_command.blank? msg = <<~MSG - You are using the React on Rails test helper. + You are using the React on Rails test helper. Either you used: ReactOnRails::TestHelper.configure_rspec_to_compile_assets or ReactOnRails::TestHelper.ensure_assets_compiled diff --git a/lib/react_on_rails/utils.rb b/lib/react_on_rails/utils.rb index 8c2495fb9b..e9dfa0ff5a 100644 --- a/lib/react_on_rails/utils.rb +++ b/lib/react_on_rails/utils.rb @@ -34,7 +34,7 @@ def self.wrap_message(msg, color = :red) end def self.object_to_boolean(value) - [true, "true", "yes", 1, "1", "t"].include?(value.class == String ? value.downcase : value) + [true, "true", "yes", 1, "1", "t"].include?(value.instance_of?(String) ? value.downcase : value) end def self.server_rendering_is_enabled? @@ -118,9 +118,11 @@ def self.rails_version_less_than(version) end end + # rubocop:disable Naming/VariableNumber def self.rails_version_less_than_4_1_1 rails_version_less_than("4.1.1") end + # rubocop:enable Naming/VariableNumber module Required def required(arg_name) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index fdb53cce50..87b40ccfa6 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -40,10 +40,10 @@ end namespace :react_on_rails do namespace :assets do desc <<-DESC.strip_heredoc - Compile assets with webpack - Uses command defined with ReactOnRails.configuration.build_production_command - sh "#{ReactOnRails::Utils.prepend_cd_node_modules_directory('')}" - Note: This command is not automatically added to assets:precompile if the rails/webpacker + Compile assets with webpack + Uses command defined with ReactOnRails.configuration.build_production_command + sh "#{ReactOnRails::Utils.prepend_cd_node_modules_directory('')}" + Note: This command is not automatically added to assets:precompile if the rails/webpacker configuration file config/webpack/production.js exists. DESC task webpack: :locale do diff --git a/rakelib/docker.rake b/rakelib/docker.rake index 467569104a..6fb0ddaebf 100644 --- a/rakelib/docker.rake +++ b/rakelib/docker.rake @@ -6,11 +6,6 @@ namespace :docker do sh "docker-compose run lint rake lint:rubocop" end - desc "Run ruby-lint linter from docker" - task :ruby do - sh "docker-compose run lint rake lint:ruby" - end - desc "Run scss-lint linter from docker" task :scss do sh "docker-compose run lint rake lint:scss" diff --git a/rakelib/lint.rake b/rakelib/lint.rake index 17ca283e75..2e30fdd4eb 100644 --- a/rakelib/lint.rake +++ b/rakelib/lint.rake @@ -7,13 +7,7 @@ namespace :lint do desc "Run Rubocop as shell" task :rubocop do - sh_in_dir(gem_root, "bundle exec rubocop .") - end - - desc "Run ruby-lint as shell" - task :ruby do - puts "See /ruby-lint.yml for what directories are included." - sh_in_dir(gem_root, "bundle exec ruby-lint .") + sh_in_dir(gem_root, "bundle exec rubocop --version", "bundle exec rubocop .") end desc "Run scss-lint as shell" @@ -23,10 +17,10 @@ namespace :lint do desc "Run eslint as shell" task :eslint do - sh_in_dir(gem_root, "yarn run eslint") + sh_in_dir(gem_root, "yarn run eslint --version", "yarn run eslint .") end - desc "Run all eslint & rubocop linters. Skip ruby-lint and scss" + desc "Run all eslint & rubocop linters. Skip scss" task lint: %i[eslint rubocop] do puts "Completed all linting" end diff --git a/rakelib/task_helpers.rb b/rakelib/task_helpers.rb index 0e773efc43..678d3ff24d 100644 --- a/rakelib/task_helpers.rb +++ b/rakelib/task_helpers.rb @@ -17,9 +17,8 @@ def dummy_app_dir end # Executes a string or an array of strings in a shell in the given directory - def sh_in_dir(dir, shell_commands) - shell_commands = [shell_commands] if shell_commands.is_a?(String) - shell_commands.each { |shell_command| sh %(cd #{dir} && #{shell_command.strip}) } + def sh_in_dir(dir, *shell_commands) + shell_commands.flatten.each { |shell_command| sh %(cd #{dir} && #{shell_command.strip}) } end def bundle_install_in(dir) diff --git a/react_on_rails.gemspec b/react_on_rails.gemspec index d2aead0848..7fa28a7db8 100644 --- a/react_on_rails.gemspec +++ b/react_on_rails.gemspec @@ -32,27 +32,11 @@ Gem::Specification.new do |s| s.add_dependency "rainbow", "~> 3.0" s.add_dependency "webpacker", ">= 4.0" - s.add_development_dependency "awesome_print" - s.add_development_dependency "bundler", "~> 2" - s.add_development_dependency "coveralls" - s.add_development_dependency "gem-release" - s.add_development_dependency "generator_spec" - s.add_development_dependency "listen" - s.add_development_dependency "pry" - s.add_development_dependency "pry-byebug" - s.add_development_dependency "pry-doc" - s.add_development_dependency "pry-rescue" - s.add_development_dependency "pry-state" - s.add_development_dependency "rails" - - s.add_development_dependency "rake" - s.add_development_dependency "rspec" - s.add_development_dependency "rubocop" - s.post_install_message = ' -------------------------------------------------------------------------------- -Email contact@shakacode.com for access to our slack room and information about our "pro support plan" -which supports better performance, via caching helpers and our node rendering server. +Checkout https://www.shakacode.com/react-on-rails-pro for information about +"React on Rails Pro" which includes one hour a month of support and a gem for +better performance, via caching helpers, and our node rendering server. -------------------------------------------------------------------------------- ' end diff --git a/ruby-lint.yml b/ruby-lint.yml deleted file mode 100644 index d8556e4c74..0000000000 --- a/ruby-lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Not currently using ruby-lint ---- -presenter: syntastic - -# Be sure to edit this per your project! -directories: - - app - - lib - - spec - -ignore_paths: - - client - - node_modules - - coverage - - examples - -analysis_classes: - # - argument_amount - - pedantics - - shadowing_variables - # Too many false positives for these - # - undefined_methods - # - undefined_variables - # - unused_variables - - useless_equality_checks diff --git a/spec/dummy/.rubocop.yml b/spec/dummy/.rubocop.yml new file mode 100644 index 0000000000..8d848aee05 --- /dev/null +++ b/spec/dummy/.rubocop.yml @@ -0,0 +1,16 @@ +inherit_from: + - ../../.rubocop.yml + +AllCops: + Exclude: + - 'Procfile.*' + - 'bin/**/*' + - 'client/**/*' + - 'db/schema.rb' + - 'node_modules/react-on-rails' + - 'node_modules/**/*' + - 'public/webpack/**/*' + +Metrics/BlockLength: + Exclude: + - 'config/routes.rb' diff --git a/spec/dummy/Gemfile b/spec/dummy/Gemfile index d111b8b79d..a2bcc402b7 100644 --- a/spec/dummy/Gemfile +++ b/spec/dummy/Gemfile @@ -2,77 +2,6 @@ source "https://rubygems.org" -eval_gemfile File.expand_path("../../react_on_rails.gemspec", __dir__) +eval_gemfile File.expand_path("../../Gemfile.development_dependencies", __dir__) gem "react_on_rails", path: "../.." - -# We'll revert this before the final merge. -# gem "webpacker", git: 'https://github.com/rails/webpacker.git' -gem "webpacker" - -gem "bootsnap", ">= 1.1.0", require: false -gem "rails" - -# Use sqlite3 as the database for Active Record -gem "sqlite3" -# Use SCSS for stylesheets -gem "sass-rails" -# Use Uglifier as compressor for JavaScript assets -gem "uglifier" -# Use CoffeeScript for .coffee assets and views -gem "coffee-rails" - -# Use jquery as the JavaScript library -gem "jquery-rails" - -gem "puma" - -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem "turbolinks" if ENV["DISABLE_TURBOLINKS"].nil? || ENV["DISABLE_TURBOLINKS"].strip.empty? - -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem "jbuilder" -# bundle exec rake doc:rails generates the API under doc/api. -gem "sdoc", group: :doc - -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use Unicorn as the app server -# gem 'unicorn' - -gem "sprockets", "~>3.0" - -# Use Capistrano for deployment -# gem 'capistrano-rails', group: :development -gem "awesome_print" -gem "mini_racer" - -group :development, :test do - gem "listen" - gem "pry" - gem "pry-byebug" - gem "pry-doc" - gem "pry-rails" - gem "pry-rescue" - gem "rubocop", require: false - gem "ruby-lint", require: false - gem "scss_lint", require: false - - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem "spring" -end - -group :test do - gem "capybara" - gem "capybara-screenshot" - gem "coveralls", require: false - gem "equivalent-xml" - gem "generator_spec" - gem "launchy" - gem "rspec_junit_formatter" - gem "rspec-rails" - gem "rspec-retry" - gem "selenium-webdriver" - gem "webdrivers", "~> 3.0" -end diff --git a/spec/dummy/Gemfile.lock b/spec/dummy/Gemfile.lock index ce47ead5ec..7fea6ce8b2 100644 --- a/spec/dummy/Gemfile.lock +++ b/spec/dummy/Gemfile.lock @@ -12,56 +12,56 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.3.3) - actionpack (= 6.0.3.3) + actioncable (6.0.3.4) + actionpack (= 6.0.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.3) - actionpack (= 6.0.3.3) - activejob (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + actionmailbox (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) mail (>= 2.7.1) - actionmailer (6.0.3.3) - actionpack (= 6.0.3.3) - actionview (= 6.0.3.3) - activejob (= 6.0.3.3) + actionmailer (6.0.3.4) + actionpack (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.3.3) - actionview (= 6.0.3.3) - activesupport (= 6.0.3.3) + actionpack (6.0.3.4) + actionview (= 6.0.3.4) + activesupport (= 6.0.3.4) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.3.3) - actionpack (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + actiontext (6.0.3.4) + actionpack (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) nokogiri (>= 1.8.5) - actionview (6.0.3.3) - activesupport (= 6.0.3.3) + actionview (6.0.3.4) + activesupport (= 6.0.3.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.3.3) - activesupport (= 6.0.3.3) + activejob (6.0.3.4) + activesupport (= 6.0.3.4) globalid (>= 0.3.6) - activemodel (6.0.3.3) - activesupport (= 6.0.3.3) - activerecord (6.0.3.3) - activemodel (= 6.0.3.3) - activesupport (= 6.0.3.3) - activestorage (6.0.3.3) - actionpack (= 6.0.3.3) - activejob (= 6.0.3.3) - activerecord (= 6.0.3.3) + activemodel (6.0.3.4) + activesupport (= 6.0.3.4) + activerecord (6.0.3.4) + activemodel (= 6.0.3.4) + activesupport (= 6.0.3.4) + activestorage (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) marcel (~> 0.3.1) - activesupport (6.0.3.3) + activesupport (6.0.3.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -71,7 +71,7 @@ GEM public_suffix (>= 2.0.2, < 5.0) ast (2.4.1) awesome_print (1.8.0) - bootsnap (1.4.8) + bootsnap (1.5.1) msgpack (~> 1.0) builder (3.2.4) byebug (11.1.3) @@ -83,18 +83,11 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - capybara-screenshot (1.0.24) + capybara-screenshot (1.0.25) capybara (>= 1.0, < 4) launchy childprocess (3.0.0) coderay (1.1.3) - coffee-rails (5.0.0) - coffee-script (>= 2.2.0) - railties (>= 5.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) concurrent-ruby (1.1.7) connection_pool (2.2.3) coveralls (0.8.23) @@ -108,7 +101,7 @@ GEM docile (1.3.2) equivalent-xml (0.6.0) nokogiri (>= 1.4.3) - erubi (1.9.0) + erubi (1.10.0) execjs (2.7.0) ffi (1.13.1) generator_spec (0.9.4) @@ -129,7 +122,7 @@ GEM launchy (2.5.0) addressable (~> 2.7) libv8 (8.4.255.0) - listen (3.2.1) + listen (3.3.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.7.0) @@ -150,8 +143,8 @@ GEM nio4r (2.5.4) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - parallel (1.19.2) - parser (2.7.1.5) + parallel (1.20.0) + parser (2.7.2.0) ast (~> 2.4.1) pry (0.13.1) coderay (~> 1.1) @@ -168,36 +161,36 @@ GEM interception (>= 0.5) pry (>= 0.12.0) public_suffix (4.0.6) - puma (5.0.2) + puma (5.0.4) nio4r (~> 2.0) rack (2.2.3) rack-proxy (0.6.5) rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.3.3) - actioncable (= 6.0.3.3) - actionmailbox (= 6.0.3.3) - actionmailer (= 6.0.3.3) - actionpack (= 6.0.3.3) - actiontext (= 6.0.3.3) - actionview (= 6.0.3.3) - activejob (= 6.0.3.3) - activemodel (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + rails (6.0.3.4) + actioncable (= 6.0.3.4) + actionmailbox (= 6.0.3.4) + actionmailer (= 6.0.3.4) + actionpack (= 6.0.3.4) + actiontext (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) + activemodel (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) bundler (>= 1.3.0) - railties (= 6.0.3.3) + railties (= 6.0.3.4) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.3.3) - actionpack (= 6.0.3.3) - activesupport (= 6.0.3.3) + railties (6.0.3.4) + actionpack (= 6.0.3.4) + activesupport (= 6.0.3.4) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) @@ -207,16 +200,16 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rdoc (6.2.1) - regexp_parser (1.8.1) + regexp_parser (1.8.2) rexml (3.2.4) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) + rspec-core (3.10.0) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) + rspec-support (~> 3.10.0) rspec-rails (4.0.1) actionpack (>= 4.2) activesupport (>= 4.2) @@ -227,23 +220,20 @@ GEM rspec-support (~> 3.9) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.3) + rspec-support (3.10.0) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.92.0) + rubocop (1.2.0) parallel (~> 1.10) parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) + regexp_parser (>= 1.8) rexml - rubocop-ast (>= 0.5.0) + rubocop-ast (>= 1.0.1) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.7.1) + rubocop-ast (1.1.1) parser (>= 2.7.1.5) - ruby-lint (2.3.1) - parser (~> 2.2) - slop (~> 3.4, >= 3.4.7) ruby-progressbar (1.10.1) rubyzip (1.3.0) sass (3.7.4) @@ -263,7 +253,7 @@ GEM tilt scss_lint (0.59.0) sass (~> 3.5, >= 3.5.5) - sdoc (1.1.0) + sdoc (2.0.2) rdoc (>= 5.0) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) @@ -274,9 +264,8 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - slop (3.6.0) spring (2.1.1) - sprockets (3.7.2) + sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.2) @@ -290,12 +279,12 @@ GEM thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) - tins (1.25.0) + tins (1.26.0) sync turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.7) + tzinfo (1.2.8) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) @@ -315,7 +304,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yard (0.9.25) - zeitwerk (2.4.0) + zeitwerk (2.4.1) PLATFORMS ruby @@ -325,7 +314,6 @@ DEPENDENCIES bootsnap (>= 1.1.0) capybara capybara-screenshot - coffee-rails coveralls equivalent-xml generator_spec @@ -345,14 +333,13 @@ DEPENDENCIES rspec-rails rspec-retry rspec_junit_formatter - rubocop - ruby-lint + rubocop (= 1.2.0) sass-rails scss_lint sdoc selenium-webdriver spring - sprockets (~> 3.0) + sprockets sqlite3 turbolinks uglifier diff --git a/spec/dummy/app/assets/config/manifest.js b/spec/dummy/app/assets/config/manifest.js new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/spec/dummy/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +{ +} diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 10bbffbf77..6a3ac29292 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -12,5 +12,7 @@ # # It's strongly recommended that you check this file into your version control system. +# rubocop:disable Lint/EmptyBlock ActiveRecord::Schema.define(version: 0) do end +# rubocop:enable Lint/EmptyBlock diff --git a/spec/.rubocop.yml b/spec/dummy/spec/.rubocop.yml similarity index 83% rename from spec/.rubocop.yml rename to spec/dummy/spec/.rubocop.yml index 3ea5b1ae66..a56154490e 100644 --- a/spec/.rubocop.yml +++ b/spec/dummy/spec/.rubocop.yml @@ -2,4 +2,4 @@ inherit_from: - ../.rubocop.yml Metrics/BlockLength: - Max: 180 + Max: 200 diff --git a/spec/react_on_rails/.rubocop.yml b/spec/react_on_rails/.rubocop.yml new file mode 100644 index 0000000000..09336f757a --- /dev/null +++ b/spec/react_on_rails/.rubocop.yml @@ -0,0 +1,5 @@ +inherit_from: + - ../../.rubocop.yml + +Metrics/BlockLength: + Max: 145 diff --git a/spec/react_on_rails/configuration_spec.rb b/spec/react_on_rails/configuration_spec.rb index da307bd96f..9ef816344f 100644 --- a/spec/react_on_rails/configuration_spec.rb +++ b/spec/react_on_rails/configuration_spec.rb @@ -150,8 +150,10 @@ module ReactOnRails end it "has a default configuration of the gem" do + # rubocop:disable Lint/EmptyBlock ReactOnRails.configure do |_config| end + # rubocop:enable Lint/EmptyBlock expect(ReactOnRails.configuration.random_dom_id).to eq(true) end