From fd41570d4f6ccb757f78fe92aab499b8c3bcca6d Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:19:31 -0500 Subject: [PATCH 1/4] temp commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 354803e5..45216347 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## News V3.0.0 is released with Shakapacker v7 support, including SSR. Please try it out and report any issues. We'll try to address any critical issues ASAP. -For version 2.7 documentation checkout [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch. +For version 2.7 documentation, visit the [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch. ## Summary React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits: From b1a0745ab0288c10ee87de52b8b50534fa7de69c Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 18:47:16 -0500 Subject: [PATCH 2/4] add linting gems to dev Gemfile --- Gemfile | 3 +++ Gemfile.lock | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 8926579c..d60f3f49 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,6 @@ source "http://rubygems.org" gemspec # This is an optional dev-dependency, required whenever sprockets is required +gem "rubocop" +gem "rubocop-minitest" +gem "rubocop-performance" diff --git a/Gemfile.lock b/Gemfile.lock index 4583cca9..73b8b9f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,7 @@ GEM bundler rake thor (>= 0.14.0) + ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -92,6 +93,7 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.3.0) + language_server-protocol (3.17.0.3) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -102,12 +104,8 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.0.2) - mini_portile2 (2.8.5) minitest (5.17.0) nenv (0.3.0) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) nokogiri (1.14.3-x86_64-linux) @@ -116,6 +114,10 @@ GEM nenv (~> 0.1) shellany (~> 0.0) package_json (0.1.0) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -138,12 +140,33 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) rake (13.0.1) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.6.0) rexml (3.2.5) + 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) + ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) @@ -161,13 +184,13 @@ GEM tilt (2.1.0) tzinfo (1.2.10) thread_safe (~> 0.1) + unicode-display_width (2.5.0) websocket (1.2.9) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.6) PLATFORMS - ruby x86_64-darwin-20 x86_64-linux @@ -186,6 +209,9 @@ DEPENDENCIES package_json pry-byebug react-rails! + rubocop + rubocop-minitest + rubocop-performance selenium-webdriver test-unit (~> 2.5) From fd4624b4911c51bf4b5dbab8e3eb5f12e94c8cb0 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:26:22 -0500 Subject: [PATCH 3/4] update npm global installation of yalc --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f81b04b4..ceb64820 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -89,7 +89,7 @@ jobs: with: persist-credentials: false - uses: actions/setup-node@v3 - - run: npm -g install yalc ${{ matrix.js_package_manager.installer }} + - run: sudo npm -g install yalc ${{ matrix.js_package_manager.installer }} - run: yalc publish - name: Save root node_modules to cache uses: actions/cache@v3 From 081e33c4ab9e474982abf6af37d2a8dba3aa6abe Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Fri, 12 Apr 2024 20:26:42 -0500 Subject: [PATCH 4/4] linting --- test/dummy/config/initializers/backtrace_silencers.rb | 1 + test/dummy/config/initializers/inflections.rb | 1 + test/dummy/config/initializers/mime_types.rb | 1 + test/react/jsx_test.rb | 2 +- test/react/rails/controller_lifecycle_test.rb | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb index d0f0d3b5..4b63f289 100644 --- a/test/dummy/config/initializers/backtrace_silencers.rb +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb index aa7435fb..dc847422 100644 --- a/test/dummy/config/initializers/inflections.rb +++ b/test/dummy/config/initializers/inflections.rb @@ -1,4 +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/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb index f75864f9..df5ec138 100644 --- a/test/dummy/config/initializers/mime_types.rb +++ b/test/dummy/config/initializers/mime_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/test/react/jsx_test.rb b/test/react/jsx_test.rb index c9ed8d43..25bb14ac 100644 --- a/test/react/jsx_test.rb +++ b/test/react/jsx_test.rb @@ -22,7 +22,7 @@ STR class NullTransformer - def initialize(_options = {}); end # rubocop:disable-line Style/RedundantInitialize + def initialize(_options = {}); end # rubocop:disable Style/RedundantInitialize def transform(_code) "TRANSFORMED CODE!;\n" diff --git a/test/react/rails/controller_lifecycle_test.rb b/test/react/rails/controller_lifecycle_test.rb index 03690109..4992cde9 100644 --- a/test/react/rails/controller_lifecycle_test.rb +++ b/test/react/rails/controller_lifecycle_test.rb @@ -41,7 +41,7 @@ def teardown get "/pages/1" helper_obj = controller.__react_component_helper - assert(helper_obj.is_a?(DummyHelperImplementation), "It uses the view helper implementation class") + assert_kind_of(DummyHelperImplementation, helper_obj, "It uses the view helper implementation class") end test "it calls setup and teardown methods" do