Wikimedia

Enable and fix violations for 3 rubocop violations in Ruby code

Before beginning this task, you should have set up a development environmentL https://github.com/WikiEducationFoundation/WikiEduDashboard/blob/master/docs/setup.md

The Wiki Education Dashboard runs on a Ruby on Rails backend. Style conventions are enforced using rubocop, and as new versions of rubocop are released, new linting rules are added. Somes rules are disabled as temporary exceptions in the config file, because we have not yet brought the codebase in line with those rules: https://github.com/WikiEducationFoundation/WikiEduDashboard/blob/master/.rubocop.yml

The goal of this task is to enable more of these rules and fix any violations. To complete it:

  1. ) Choose a rule from the 'Temporary exceptions' section of the config, look up that rule to understand its purpose and the details of what it does, and then delete the lines that disable that rule.
  2. ) Run bundle exec rubocop --rails to see the list of violations.
  3. ) Fix any violations of the rule. Alternatively, if you think following the rule will make the codebase worse, move the rule to the "Permanent exceptions" section of the config file and explain your reasoning in detail.
  4. ) Create a commit with the change to .rubocopy.yml and all the corresponding fixes to ruby files. Describe the purpose of the rule in the commit message (and why it should not be enabled, if you think it should become a permanent exception).
  5. ) Repeat this for two additional rules.
  6. ) Open a pull request with these three commits.

Task tags

  • ruby
  • wiki-edu-dashboard
  • linting

Students who completed this task

terppa05, kaine119, refeed

Task type

  • code Code
close

2018