Commit Graph

117 Commits

Author SHA1 Message Date
Cody Cutrer 883eac7983 bundle update rubocop
Change-Id: I1acf788123e70c9692d8d6e0891848c798d013f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/342003
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-03-04 16:21:17 +00:00
Cody Cutrer cb3e200ffd rubocop: FactoryBot
[skip-stages=Flakey]

Change-Id: Ia33d86601f9511dfdfd623ab39c15c007c829691
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341935
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-03-01 22:27:49 +00:00
Cody Cutrer 229c986615 rubocop: re-enable Lint/UriEscapeUnescape
we have no violations (likely because we upgraded to Ruby 3)

Change-Id: I64242e28afaeff72e7fbe7b972e5e9bdc1d84884
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341936
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-03-01 22:21:59 +00:00
Cody Cutrer 52b91801ba bundle update rubocop
Change-Id: I715c95f48bcbe6d1e4e97590401f7514d5cfcf1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341920
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-03-01 21:44:54 +00:00
Cody Cutrer 9d377cc778 simplify lockfile definitions
by avoiding constants

also don't add the alternate lockfiles unless we actually are the
primary gemfile (fixes ruby-lsp)

Change-Id: Icaa47ea81a35938da335b7d5632e04f2d76b1e8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/329543
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-10-06 20:16:18 +00:00
Cody Cutrer bdfe09a90e bundle update rubocop-rspec
Change-Id: Iafc3f09a92bdae4b2d873b4526cbf66b5098e8bc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328623
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-26 14:23:05 +00:00
Cody Cutrer 12a2c3784f bundle update rubocop-rspec
[skip-stages=Flakey]
[skip-crystalball]

and apply updated copys (RSpec/Eq and RSpec/MetadataStyle, and one
instance that the split RSpec/SpecFilePathSuffix caught)

Change-Id: I3872458f35b791f1ce3f8108a2aaf4fff2cfd612
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/327204
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-11 15:59:30 +00:00
Cody Cutrer 9f6688b4b8 rework google_drive for currently maintained upstream gems
google-api-client is deprecated and unmaintained; need to use
the service specific gem. this gets us on the latest APIs, and
importantly unblocks us on updating other common dependencies
(most notably a step towards updating faraday, but also retriable)

Change-Id: I646da7dc68b8c5f6068142608c19771dafbef127
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325392
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-22 23:34:10 +00:00
Cody Cutrer 8f8f6f7313 bump rubocop gems and apply changes
[skip-stages=Flakey]

Change-Id: I5f080be6efb64351b4a89e6bd6040bc6f0432e82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323854
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 20:13:35 +00:00
Cody Cutrer f32405f310 rubocop: explicitly require rubocop-factory_bot
it's been split to its own gem (still implicitly depedended on by
rubocop-rspec), and we do use factory_bot, so make sure it's getting
checked.

Change-Id: Ia49296b561f59a1503ae097535c404c1c1d5572d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320103
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-06-13 22:01:55 +00:00
Cody Cutrer 5431d47758 rubocop: Rails/I18nLocaleAssignment
manually done. the big one was the explicit locale assignment
in set_locale_with_localizer needs undone in a controller callback

then using with_locale everywhere, specs no longer need to be concerned
about being in an uncertain locale

Change-Id: I5a1d2c907a6f52ee4d8c2307b8c789a1f1ea436e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320112
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-06-13 21:59:50 +00:00
Jacob Burroughs 7dcc507d0a Rubocop for ruby 3.1
[skip-stages=Flakey]

Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-06-06 16:44:26 +00:00
Cody Cutrer 668db93ad9 rubocop: disable autocorrect for Naming/MemoizedInstanceVariableName
Change-Id: I1ac54df45a9ff5dd40ed2e5c9339e91017d75470
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319373
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-30 22:01:18 +00:00
Cody Cutrer b636c1c041 add a bundler binstub
refs AE-297

and also include binstubs in the path in docker

this will help ensure people are running the correct version of bundler

Change-Id: I68e7f6a43efd89ff257a9307aa4f6709acef05f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318776
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-05-30 17:34:50 +00:00
Cody Cutrer fef8139640 rubocop: disable autocorrect for Style/CombinableLoops
Change-Id: If32461eae84f5662e8ea9daeaa84fd3a0941fbcf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319252
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-26 20:09:58 +00:00
Cody Cutrer ede8499151 rubocop: disable Rails/WhereNotWithMultipleConditions
We're firmly on Rails 6.1+; no need to worry about legacy behavior

Change-Id: I61374cba137b340a9c9792f46898bf2179c3c62d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318969
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-23 22:24:01 +00:00
Cody Cutrer 80f97039c0 bump and apply rubocop gems
[skip-stages=Flakey]

Change-Id: I473807528062dfc9e8e983728c6d27726513686c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318465
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-05-19 18:57:17 +00:00
Cody Cutrer fdf5a03c4d rubocop: inherit config from rubocop-inst
and remove now-duplicated config

also fix a few offenses that snuck in due to code review race conditions

as part of this, Rubocop was loading the lockfile, so our "clever" rubocop
binstub had to be adjusted to use a lockfile. this allows us to commit the
lockfile, which I then also updated the sync_lockfiles script to handle
this one as well

flag = none
test plan: N/A

Change-Id: I20ee2672c5219a40e90bc1138f8900a8d2ce08ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317373
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-02 17:24:47 +00:00
Cody Cutrer 502aa068da rubocop: Layout/Multiline*LineBreaks
[skip-stages=Flakey]

Change-Id: I24912809267088bc19a4082c49bc5f78ca7b76bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-01 19:31:42 +00:00
Cody Cutrer e935048dc4 add rubocop-graphql
nothing is enforced yet, and some obviously noisy cops have been silenced

Change-Id: I12bddd724af042e30d6a8b0f5465c73036cbfa8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316045
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-04-17 15:37:46 +00:00
Cody Cutrer fc0ce801b6 linters: exclude vendor
in case you have some override gems installed, don't worry about them

Change-Id: I9f084621322eb834fc1774804bad6e433861625b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316059
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-17 15:32:43 +00:00
Cody Cutrer 7144f0c66a bump rubocop-rails
I was able to replace one of our custom cops with a built in one
(just had to make it ignore older migrations).

Then I had to manually fix a couple of (important!) offenses

Change-Id: I000310bb6b065034384ba3a33ef5e37e22b9be5a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315855
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-14 14:07:34 +00:00
Cody Cutrer fe434c28d9 bump rubocop-rspec
and manually fix a couple offenses

Change-Id: I8acefa460523b330cf62395c357ca5f0ae4e3dd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315828
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 21:21:40 +00:00
Cody Cutrer 4d96f5ed1e rubocop: update to 1.49
includes some minor hash layout fixes that were incompatible with prior rubocop

[skip-stages=Flakey]

Change-Id: I75e903292daa70c84b03600b97fac49ca1155004
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315786
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 19:27:56 +00:00
Cody Cutrer cbf9114d27 fix duplicate rubocop cop configurations
Change-Id: I64bf130a824279febd363d9a6ffa6ee62bcb24c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314725
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-30 18:18:35 +00:00
Cody Cutrer 09d77cbbc2 fix zh-Hant dynamic translations
Change-Id: Ibd2ce51b8b000f3f73c3e08c0a62ddd32c849066
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314612
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-29 21:49:59 +00:00
Aaron Ogata 7883fce765 replace default_scope override with rubocop linter
refs AC-1

Overriding default_scope here causes statement caching to never be used, so replace it with a rubocop linter.

Change-Id: Ifbe84a87ab19fc2f6032ed982fcbe8019e765dd1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305925
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2022-11-22 19:42:05 +00:00
Jeremy Stanley 7c58a814ed rubocop: disable Style/HashLikeCase
because this isn't even pointless pedantry. it's just pointless

Change-Id: I7b8cd656a4adb8da3b5e30a59593297f91d9aa9a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286846
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-03-15 16:59:27 +00:00
Aaron Ogata 77c5d89cea rubocop: disable Style/CaseLikeIf
seems overly pedantic

Change-Id: Ibe3ccd76978650842dd09fd1232df5673e292d58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287118
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-03-15 15:22:19 +00:00
Jeremy Stanley 2050e5a165 rubocop: reconfigure Style/SoleNestedConditional
to allow the modifier form, e.g. this is okay

  if condition_a || condition_b
    do_something unless condition_c && condition_d
  end

and is in fact preferable to

  if (condition_a || condition_b) && !(condition_c && condition_d)
    do_something
  end

which is what rubocop would turn it into otherwise

Change-Id: I1b917e3ea5149379f22e70294d263b713b3b9b35
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282475
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-01-10 23:36:08 +00:00
Jeremy Stanley c682e9946b disable Performance/CaseCmp
because it gives bad advice. `str.casecmp("foo").zero?` is not only
less clear than `str.downcase == "foo"`, but it is not Unicode-aware

(ironically, `str.casecmp?("foo")`, with the question mark, _is_
Unicode-aware)

Change-Id: I1abd17f4a09b205073998c5cf9e89cb4bd85ad6b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282294
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-01-06 22:44:23 +00:00
Jeremy Stanley af8d0fe079 lint use of add_foreign_key
test plan:
 - create a migration (locally) and add it to a commit
   (no need to actually commit, push, or even run the migration)
   that adds a foreign key to an existing table, e.g.

   add_foreign_key :users, :eportfolios

 - run script/rlint, and it should complain that you should
   use a non-transactional migration and add `delay_validation: true`
   to the arguments
 - do those things, run script/rlint again, and it should not
   complain
 - add a foreign key to a table created in the same migration,
   e.g.

   create_table :foo do |t|
   end
   add_foreign_key :foo, :bar

 - run script/rlint again, and it shouldn't complain

flag=none
closes DE-940

Change-Id: I3f235cbf1ff4011e20d74bdaa8953b857c7e330a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280514
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-12-13 20:04:44 +00:00
Jeremy Stanley 73f2bc8be6 allow Migration cops to set their own severity
since planned cops may provide different severity levels
depending on circumstances

refs DE-942

flag = none

Change-Id: I7501c13ea350241c47debceb7440cc8ce3d43925
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-12-08 20:10:41 +00:00
Cody Cutrer a2a70c0b81 rubocop: disable Lint/RedundantCopDisableDirective temporarily
it's removing disable directives that need to be there

Change-Id: Iecff7d5559742af834946a6d9223fd24634baa90
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279693
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-29 16:33:46 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer eaca556b81 RuboCop: Style/NumericLiterals
[skip-stages=Flakey]

auto-corrected

Change-Id: I88363d87d5a70be941aa81b4ffe5306ce7506b98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279207
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:31:34 +00:00
Cody Cutrer 8491e88508 RuboCop: RSpec/ItBehavesLike
[skip-stages=Flakey]

auto-corrected

Change-Id: I56e3012374105679ccbb9947a043542330424b4e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279506
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:31:06 +00:00
Cody Cutrer 8c37fa9ac3 RuboCop: RSpec/LetBeforeExamples, RSpec/LeadingSubject
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia794667280669652b7da12f8e351f25bed25e32b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279460
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:30:52 +00:00
Cody Cutrer 1f40a6f50f RuboCop: RSpec/Rails/HttpStatus
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia1b3aabd3a12c3fe1fba7ccaf53e730791192626
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279436
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:30:38 +00:00
Cody Cutrer b955e57956 RuboCop: RSpec/ImplicitSubject
[skip-stages=Flakey]

auto-corrected

Change-Id: I07c2cf064ab446b8ac020af3ad9e57c0d4d9372b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279434
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:30:23 +00:00
Cody Cutrer 13949b825b RuboCop: RSpec/RepeatedExample, RSpec/RepeatedExampleGroupBody
[skip-stages=Flakey]

manual. obvious duplicates were removed. others I looked for context on what
the original copy/paste error was.

Change-Id: I6d009c480eacf9233ed0c8253ce715bc2f74e8bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279432
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:30:10 +00:00
Cody Cutrer 8ee4c4777a RuboCop: RSpec/RepeatedExampleGroupDescription
[skip-stages=Flakey]

manual, mostly by fixing copy/paste name problems,
combining groups that didn't need separating, or creating
new groups to contain contiguous top level groups that can't
be combined due to having different setup

Change-Id: I5b21664eabd8c3a62e22c09a28ba8bf519371aa5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279428
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:29:56 +00:00
Cody Cutrer f419d77cde rubocop: add missing non-error cops
Change-Id: I7691d98cb0f1a2d0452990c8e93968e950406c51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279427
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-24 23:29:39 +00:00
Cody Cutrer ee33b6b896 RuboCop: RSpec/RepeatedIncludeExample
manual

Change-Id: Ibc02e7d29fb346b9245a73fde2114191f4ed1fcb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279422
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:32:01 +00:00
Cody Cutrer c1bfffa8df RuboCop: RSpec/VoidExpect
manual

Change-Id: Ia1e83f9e901a27aaa02135a82cfe0ad5a3e3bf7e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279421
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:31:50 +00:00
Cody Cutrer e910bf28f7 RuboCop: Style/YodaCondition
auto-corrected

Change-Id: Ic9788248ec1ea08928cea603ab1c800f2f3064e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279419
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:31:39 +00:00
Cody Cutrer 379d5d7611 rubocop: default to error severity
means we can remove a whole bunch of specific cop configurations that
now inherit the proper settings. cops that still have violations need
to be explicitly named to make them not error. this means that the
list of remaining cops is explicitly in our config now. also combined
the don't-auto-correct lists with the not-yet-fixed lists, so that
it's only a "permanent" section and a "todo" section

the final computed configuration is unchanged by this commit, with one
exception - Bundler/OrderedGems was moved to the Gemfile.d/.rubocop.yml
override, and some of the internal gems violated that so their
gemfiles have been autocorrected

Change-Id: I100884a96dbe9eb9d4bfc0692663c271daa9de16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279413
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:31:26 +00:00
Cody Cutrer e0600a99a4 rubocop: remove .rubocop.common.yml
we're far enough along that the generated disablings are no longer useful

Change-Id: Iec341384f7a5f6eeb42bad4ae1ea12f433d270a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279397
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:31:12 +00:00
Cody Cutrer b68d11de70 rubocop: go back to a single .rubocop.yml
it was just too confusing on which one an editor is using, double comments
in jenkins, etc.

this is accomplished by several things:
 * required cops are just marked as severe, instead of using a separate
   config for them, and failing if anything shows up from that config
 * get rid of all the logic to only include certain directories for
   certain cops. turns out it's not _that_ ominous to correct errors
   across the entire repository before marking a cop as required.
 * but still auto-generate config to turn _off_ autocorrect for
   non-severe cops. this is important because auto-correct must run
   for entire files, and we don't want it auto-correcting optional
   things that you didn't touch.
 * update gergich to get more details from the parsed comments.
   this plus the prior point means we _don't_ have to have heavy mode when
   in autocorrecting, but we still display out-of-context lines that were
   autocorrected

this also makes it so we can use per-dir .rubocop.yml files again, so
take some of the exceptions out of the root and put them in their own
directory

Change-Id: Ie936d1a9920b68910acd250ba817c7b4a670b958
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274394
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-27 17:21:02 +00:00