Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5287

Mongoid: Code audit with Rubocop

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Let's install Rubocop on all Ruby projects (Mongoid first) to improve code quality and performance. I'm happy to contribute to the work if the team can commit to reviewing the PRs in a timely fashion.

      My proposal is:

      • Install Rubocop to latest and TargetRubyVersion to 2.5
      • Run autogen command to make rubocop-todo.yml. This whitelists all existing issues in your code, so that Rubocop passes.
      • Add Rubocop to the CI, so that new PRs must conform to Rubocop standards.
      • Fix one "cop" (check) per PR across entire codebase.
      • PRs must only change code syntax without affecting functionality.
      • Try to adopt the best-practice conventions from Rubocop. For example, %w(...) will change to %w[...], etc.

      I've done this on many gems and my own application many times, so I'm confident we can get a good result with no functional impact.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: