Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop change documentation #264

Closed
3 tasks done
pengyin-shan opened this issue Nov 21, 2022 · 4 comments
Closed
3 tasks done

Rubocop change documentation #264

pengyin-shan opened this issue Nov 21, 2022 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@pengyin-shan
Copy link

pengyin-shan commented Nov 21, 2022

Part of 3.1.0 migration is to enable rubocop Github test again. For the current rubocop workflow, rubocop is using the version in Gemfile.lock, while in the main codebase, rubocop uses the default version with ruby 2.7.6.

I noticed that since DMP Assisant 3.0.4-15 has upgraded to ruby 2.7.6 because a bug fix only applied to ruby>=2.7, thus DMP Assisant 3.1.0 will use ruby 2.7.6 with Rails 5.2.8.1. An initial update shows that rubocop is 1.39.0 with RUBY VERSION 2.6.3p62 and BUNDLED WITH 2.3.25.

  • In the main code base, robucup stays the same verson till v4.0. Robucup was 1.26.1 with RUBY VERSION ruby 2.6.3p62 BUNDLED WITH 2.2.33.
  • From 4.0 upgraded to 1.37.1 with RUBY VERSION 2.7.6p219 and BUNDLED WITH 2.3.15.

The next step is to test if 1.39.0 will generate similar results to 1.26.1 and 1.37.1.

@pengyin-shan pengyin-shan added the documentation Improvements or additions to documentation label Nov 21, 2022
@pengyin-shan pengyin-shan self-assigned this Nov 21, 2022
@pengyin-shan
Copy link
Author

pengyin-shan commented Nov 22, 2022

3.1.0 initial version: using rubop 1.39.0 with Rails 5 and ruby 2.7.6. updated rubocop.yml to be same as the main codebase.

  • A initial run of Rubocop got 573 files inspected, 251 offenses detected, 102 offenses autocorrectable
  • rubocop -A got:
573 files inspected, 264 offenses detected, 183 offenses corrected
The following RuboCop extension libraries are installed but not loaded in the config:
  * rubocop-rails # main codebase disabled it in Gemfile
  * rubocop-rspec # main codebase disabled it in Gemfile
  • A re-run of Rubocop got 573 files inspected, 79 offenses detected
  • While same rubocop running in development branch of main code base is fully passed:
558 files inspected, no offenses detected

Tip: Based on detected gems, the following RuboCop extension libraries might be helpful:
  * rubocop-rails (https://rubygems.org/gems/rubocop-rails)
  * rubocop-rspec (https://rubygems.org/gems/rubocop-rspec)

A check of the 79 offenses:

Although we see many offenses, it only belongs to following 23 files (from the excel file I used for record) :
Screenshot 2022-11-22 at 11 50 34 AM

All blue ones are DMP Assisant config/customized related files. We changed them and should be good to go in the future.
All yellow ones are app model or controller but with our customization, such as exportable_plan.rb


Overall speaking, a rubocop one-time fix should be actionable. The offenses were not as many as I estimated before.

@pengyin-shan
Copy link
Author

Compared to the main codebase, the rubocop auto-fix seems didn't cause any difference (checked plan_controller.rb as example). Will continue to watch it

@pengyin-shan
Copy link
Author

As a note, the attached full status file marks the issues, 3.1.0 status, my notes and which are issues that need to be turned back in future migrations:

Screenshot 2022-11-25 at 5 28 38 PM

Make sure to check this in 3.1.1 migration and future migration:
result.json.xlsx

@pengyin-shan
Copy link
Author

The Excel file
result.json.xlsx
contains highlighted rubocop status. Rubocop and sub-issues have all been fixed in 3.1.0. Close this ticket for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant