Commit Graph

67 Commits

Author SHA1 Message Date
Cody Cutrer 9d7a41f5ea RuboCop: tweak common config
document why each cop is disabled, disable a few more globally, and document
the intentions for each currently disabled cops in the optional config

Change-Id: I7abaabd76142a61e1922f55da0c8abb6a665ec05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274265
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-24 02:15:54 +00:00
Cody Cutrer 475cec61e5 RuboCop: RSpec/ExampleWording gems
[skip-stages=Flakey]

Change-Id: I7bd5d93d0ec4a95971f7ce8fbff8e76b5bfea5a2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274249
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-24 02:14:45 +00:00
Cody Cutrer e9d63396ff rubocop: split configuration
* remove spurious .rubocop.yml override files
 * split the configuration into an enforced and optional
 * run both configurations in jenkins (may result in some duplicate
   comments at different levels)
 * auto-correct the enforced configuration in the pre-commit hook
 * fix comments for Gemfile.d and the root dir; enforced configuration
   is only applied to that directory for now

Change-Id: I8da21073d74e19138b1b580d66c7aae6465348d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273898
Reviewed-by: Simon Williams <simon@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-09-21 16:02:22 +00:00
Kyle Rosenbaum 5340b96ad0 bump rubocop TargetRubyVersion to match current version in use
Change-Id: I053a97987999230eb9c735383896782721de67ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272934
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-09-03 21:40:27 +00:00
Cody Cutrer 2ef11140c2 remove ModelBehavior cop
it's disabled anyway, and because the cop requires active_record itself,
it adds 0.5s to the boot time of rubocop

Change-Id: Ie22944afef9df45fe08ea0e13857a4703d1c53f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271959
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 21:21:54 +00:00
Cody Cutrer 595219274c update rubocop
and rubocop-rails was split out to a dedicated gem

Change-Id: I12b45540a400aab0d57db303457103516ab92df7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271931
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-08-24 18:14:03 +00:00
Cody Cutrer 9d0cee678f require latest IRB
for multi-line paste fix. which allows us to relax the DotPosition
rubocop rule

Change-Id: I33df7de1907c2397bba8c9581d1f65b7c90c4b93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262191
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-04-05 16:03:14 +00:00
Cody Cutrer 88243a9219 just disable rubocop metrics
they make our rubocop SnR waaaay too bad right now that we ignore everything

Change-Id: Ie0145be67ee5aec54692f4c463f2bd2c2ab41518
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260505
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-03-11 23:18:54 +00:00
Ethan Vizitei 6d2b297bc0 let canvas use outrigger for migration tagging
refs FOO-1644

when other engines need migrations, we have to
be able to move "tagged" migrations down to them.
Letting outrigger manage the dependency
is nice since we extracted it from canvas anyway.

TEST PLAN:
  1) nothing about migrations changes

Change-Id: I93d2683cc05584ed9bf871b61e06ba39b70a3f5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260370
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-03-10 20:31:31 +00:00
Cody Cutrer 591c21f38b enforce frozen_string_literal comment
Change-Id: I5c0b7625bb22e4e285040201cddb8ab330f494bc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251306
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-28 22:08:52 +00:00
Kyle Rosenbaum 025556caf3 bump rubocop version to 0.68.0 to support ruby 2.6
this changes upgrades to the earliest version of rubocop
supporting ruby 2.6 while also choosing a version that fixes
a breaking 0.60.0 change to revert psych version change.

namespace changes were made on multiple cops to support
the new rubocop version requirements as well as the change to
move performance cops out of the rubocop gem in to
rubocop-performance.

the Layout/IndentFirstParameter cop is currently broken but a
rubocop version upgrade will fix that. the FreezeConstants cop
also required a fix to handle nil types.

refs DE-289

test plan:
- ensure rubocop runs completely

Change-Id: I0ca68f426e287b5a973b96a4ae0e975f1cbc0240
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248786
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2020-09-29 16:09:54 +00:00
Ethan Vizitei c8a78ae2ef let rubocop use current ruby
Change-Id: Iebba16cca11d7289b1a241d262694907de7210c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247932
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-09-17 17:50:11 +00:00
gaojun ea7e9e6644 Remove duplicated config in .rubocop.yml
closes #1565

test plan: rubocop still works

Change-Id: I77752b64224e176e5a4aff6d470cd85354b05474
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225005
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-01-30 22:41:56 +00:00
Derek Bender 1636eff98b spec: remove ExpectChange and TimesMap
some hot takes:
 - 4.times.map is more readible to Array.new(4).map and has no perf gain
   in small cases which is the overwhelming use case for specs. This
   also has no perf impact for app code since it's excluded for specs only.
 - change { AnonymousOrModerationEvent.count } is more readible than
   change(AnonymousOrModerationEvent, :count) because the former is the
   exact code you would see in your app code. This is an RSpec only cop
   so it has no impact on app code.

Change-Id: I6f70b6a9f69a3375cf6f8db27eadd810f25361ca
Reviewed-on: https://gerrit.instructure.com/162540
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-08-31 14:53:41 +00:00
Derek Bender 976116302e remove curly brace block warning in specs
Change-Id: I8f7978adacf41792b3ca3c1e5ea3b09c29b5403e
Reviewed-on: https://gerrit.instructure.com/159896
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
2018-08-09 22:07:06 +00:00
Cody Cutrer a349102c9b rubocop: I don't care how you phrase this
use whichever feels natural

Change-Id: If69da65173c7d2a55ff50b9201a7884e8ed5ad96
Reviewed-on: https://gerrit.instructure.com/159475
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-08-02 19:30:30 +00:00
Tucker McKnight 892b0c40f9 spec: Ignore block length rule in Pact tests
We're already ignoring it in RSpec and Selenium tests. And Pact
tests inherently have a lot of lines.

Change-Id: Ia976224a03426864beb04d885011e982d4c2a60d
Reviewed-on: https://gerrit.instructure.com/156583
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Tucker McKnight <tmcknight@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
2018-07-09 20:50:41 +00:00
Derek Bender 0901ee332d ignore EnsureSpecExtension for shared_examples
Change-Id: I011dc7a8b034d41a82f1c2ddfa69124ca6787ff8
Reviewed-on: https://gerrit.instructure.com/151698
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-06-05 16:00:37 +00:00
Cody Cutrer 1b46c3c904 don't care about this cop
Change-Id: Ifc88e4990278400c148d2e02326a3658f6b744a6
Reviewed-on: https://gerrit.instructure.com/148093
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-04-25 20:14:29 +00:00
Derek Bender 3c307e8017 disable SymbolArray rubocop
Change-Id: I70eb38d9097e33236ba04cc013776658304f0b06
Reviewed-on: https://gerrit.instructure.com/144062
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-03-20 16:43:38 +00:00
Derek Bender 56ccc33740 disable Migration/ModelBehavior rubocop
Change-Id: I68dc9f454d31bf4be75e7fba4dea6d0af75da10c
Reviewed-on: https://gerrit.instructure.com/144147
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-03-20 16:30:02 +00:00
Cody Cutrer a3fec55f75 change rubocop's end alignment param
to be the one we used most often

Change-Id: I0ed597588f48d2d3f57111c5a409b1304ebab666
Reviewed-on: https://gerrit.instructure.com/143446
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2018-03-14 16:09:42 +00:00
Jeremy Neander ec511dbf16 disable Style/FormatStringToken rubocop
test plan:
 * N/A

Change-Id: I0c607f5c33742b824738dd423433c8111c54b3e2
Reviewed-on: https://gerrit.instructure.com/142460
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Neander <jneander@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
2018-03-02 20:10:03 +00:00
Cody Cutrer 70bdce84f2 relax some rubocop nits
yes, some of them are kind of sad/bad. but the signal to noise with them
on is so bad that we end up ignoring far more useful advice because
we ignore gergich completely

Change-Id: Ie62b9e4c6459440c7c6cfaa29bae8271be639d77
Reviewed-on: https://gerrit.instructure.com/141069
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-02-15 18:23:47 +00:00
Derek Bender 959191321f turn off rubocop rule for ElseAlignment
Change-Id: I3278edf4da55ddb15586937a752e98674db468fa
Reviewed-on: https://gerrit.instructure.com/140633
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
2018-02-12 19:11:31 +00:00
Derek Bender 7bb338239b ignore AmbiguousBlockAssociation for specs
also fix a typo in .eslintignore caused by cae5d84950

motivation:
https://github.com/bbatsov/rubocop/issues/4222#issuecomment-290655562

this is a deliberate idiom in rspec, so let's update .robocop.yml to
match rubocop's own config

closes: GRADE-841

test plan: specs pass

Change-Id: I534eabe48fb227b6fa7b425502e645f22b1a51f3
Reviewed-on: https://gerrit.instructure.com/140424
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-02-12 18:37:09 +00:00
Keith Garner a67b4de576 update rubocop
rubocop changed the namespace on some items. This updates to the new
names so that it won't toss out warnings that things have moved.

Change-Id: Ie9003672a10adebab983b1b91393cc83a207b3c3
Reviewed-on: https://gerrit.instructure.com/136688
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Keith T. Garner <kgarner@instructure.com>
QA-Review: Keith T. Garner <kgarner@instructure.com>
2018-01-02 17:57:36 +00:00
Simon Williams a1dcb32000 bump rubocop
Change-Id: Ic510fa4a6b34227cf8c6b01bdeea98d9325d1a0d
Reviewed-on: https://gerrit.instructure.com/136139
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-12-19 23:43:23 +00:00
Cody Cutrer 66a976a181 re-enable dot position cop, but configured for end-of-line
beginning of line can be dangerous when you copy/paste into irb,
because it's not greedy, so will execute whatever looks like
the first complete statement. this may be an AR query that hasn't
been very restricted yet, accidentally destroying the database

Change-Id: I878e9e364b84ae57d79ea3185d3bddf3e6d56d8a
Reviewed-on: https://gerrit.instructure.com/133054
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-11-22 22:20:55 +00:00
Simon Williams 842fa91a00 bump rubocop to 0.51.0
Change-Id: I83c54de0e4ec48142c738568d14e54db5766dbbb
Reviewed-on: https://gerrit.instructure.com/131136
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-10-30 21:01:35 +00:00
Simon Williams 366ad8b3de bump rubocop to 0.50.0
Change-Id: I1aef2dee2089bb61bf220bd8a3640b3c90772188
Reviewed-on: https://gerrit.instructure.com/131135
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-10-30 21:01:29 +00:00
Cody Cutrer c00f437f54 bump rubocop
Change-Id: Ia8b0c7ec057ae44fb68aa4c2880587762285345a
Reviewed-on: https://gerrit.instructure.com/120803
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-28 19:32:48 +00:00
Jon Jensen 613b8c262d spec: de-dup spec descriptions, fixes SD-2181
also prevent them in the future. our test-queue fork currently has a bug
where only the last duplicate spec will run, but this is a good idea anyway

most of these are just rewordings, but in some cases delete redundant/
identical specs

test plan: specs

Change-Id: I8f51be55e750cf87ffa8150822f4b80dc99e1eb4
Reviewed-on: https://gerrit.instructure.com/103993
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-03 22:52:02 +00:00
Jon Jensen 073482ea53 spec: no more empty example groups
remove existing ones and prevent new ones

Change-Id: I995bf6c328d229846002a79739beb8eb955a8b1b
Reviewed-on: https://gerrit.instructure.com/103950
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-03 20:38:51 +00:00
Jon Jensen 4474756b74 spec: don't nitpick spies vs. message expectations
Change-Id: I380b57bc6ee4e7b8e606e5148fb0468031ccee57
Reviewed-on: https://gerrit.instructure.com/101538
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-02-09 17:23:33 +00:00
Jon Jensen fedccefdf4 spec: get rid of some rubocop-rspec nits
* before(:each) is nice since it's often right next to before(:once)
* RMessageSpies isn't a thing
* don't complain about big blocks (e.g `describe`)

Change-Id: I296433cf2478ac3a304a2e20a1a3cd5de6515678
Reviewed-on: https://gerrit.instructure.com/101502
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-02-09 16:44:30 +00:00
Simon Williams 26bda5b611 upgrade rubocop and rubocop-rspec to latest
closes CNVS-34657

test plan: rubocop should still work

Change-Id: Ibdd340dd7ba516639ee5b7225449422b324bd33a
Reviewed-on: https://gerrit.instructure.com/100831
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-02-02 16:16:39 +00:00
Jeremy Neander 2398443d78 fix rubocop rule for rspec max nesting
This fixes the rule setting the limit for nested example groups in
RSpec. Its current setting is invalid and does not work.

test plan:
* verify Jenkins passes

Change-Id: If6e03df1d9fd66bc5aacf1f78e0918086c6c73de
Reviewed-on: https://gerrit.instructure.com/100780
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2017-01-28 23:17:10 +00:00
Simon Williams 8887f62fc3 rubocop: remove duplicated rule
Change-Id: Ib916de654fa303c2c26d17ca23c6e113d212fa5f
Reviewed-on: https://gerrit.instructure.com/100204
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-01-23 16:24:37 +00:00
Jeremy Neander f28bad4d99 add rubocop rules for rspec nesting and http arguments
This disables the HttpPositionalArguments rubocop rule, which is invalid
for versions of Ruby prior to Ruby 5. This also sets the limit for
nested example groups in RSpec to 3, which is a more reasonable limit
than the default of 2.

test plan:
* verify Jenkins passes

Change-Id: I8f2badb369d6932923aa4c096c9b9014be19805a
Reviewed-on: https://gerrit.instructure.com/100198
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2017-01-21 15:14:52 +00:00
Simon Williams 967fdc5036 spec: increase rubocop allowed rspec nested groups
Change-Id: Ice28cad151efa8f58e45b88eb3b11ac248d07c7b
Reviewed-on: https://gerrit.instructure.com/100104
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-01-20 21:35:54 +00:00
Simon Williams f5c30b623d lint: tweak some cops
Change-Id: I185cc5dbfaafe64f74a511aac1ab9b94bae38d63
Reviewed-on: https://gerrit.instructure.com/98776
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-01-05 16:20:07 +00:00
Jon Jensen 3d8e304e26 deterministic described classes, refs SD-1969
This cop encourages explit require_dependency calls for ambiguous nested
constants in specs. What does that mean? Consider:

    module Analytics
      describe Assignments do

Depending on what has been required and/or autoloaded, `Assignments` could
either resolve to `Analytics::Assignments`, or just the top-level
`Assignments`. This is a cause of flickering failures and test-queue woes.
This example should either have an explicit `require_dependency` call, or
get rid of the module and just do `describe Analytics::Assignments``

Correct all existing ones in the codebase, except for a few
ActiveRecord-related ones (the auto-correct isn't quite perfect, i.e. it
assumes the file path will be `const_name.underscore`, which is no bueno
for things like ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)

Test plan:
n/a, specs

Change-Id: Ic24bf3e0f547ca11c46887d4af92804da091912a
Reviewed-on: https://gerrit.instructure.com/98752
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-01-04 21:07:07 +00:00
Simon Williams 178455d31d upgrade rubocop to 0.46.0 and rubocop-rspec to 1.8.0
note: Astrolabe::Node is now just Rubocop::Node

closes CNVS-34077

test plan: rubocop should still lint correctly

Change-Id: Id5feb1700ad78cc0b34c6cb90d2a75320b210138
Reviewed-on: https://gerrit.instructure.com/98512
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-01-03 21:25:40 +00:00
Brad Horrocks 076caec025 Moving ParallelAssignment back to style
Change-Id: If7a864309fd97f673c81b1ef2a8a59dcb838fb49
Reviewed-on: https://gerrit.instructure.com/70363
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-01-18 21:47:22 +00:00
Simon Williams f9285e3483 spec: fix aux build by pinning old rubocop version
This reverts commit 2073553507.
This reverts commit 56381d06b4.

rubocop upgraded today, and we tried a couple times to fix it, but since
we only run rubocop when ruby files change, the fixes themselves passed
the build but didn't fully fix the problem.  for now, until we can
complete an upgrade, just pin the known working version of rubocop.

Change-Id: Ib7587e5ff9f3c00817f920506208a0e20444d379
Reviewed-on: https://gerrit.instructure.com/70356
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-01-15 06:09:04 +00:00
Ethan Vizitei 56381d06b4 spec: fix aux build
rubocop wasn't version pinned, so jenkins got a later version,
and the aux build started failing because of a config difference.
this fixes the config and pins the version of rubocop

Change-Id: I5d94b779a8d29dac66ad0e121737816459c62ba3
Reviewed-on: https://gerrit.instructure.com/70337
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2016-01-14 23:38:15 +00:00
Brad Horrocks 5c4c53af18 fix rlint warning
Style/ParallelAssignment has the wrong namespace - should be Performance

Change-Id: Ic93ee267b5c2d2f2240eefdd7eb4180f3298459e
Reviewed-on: https://gerrit.instructure.com/68668
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2015-12-16 18:34:01 +00:00
Rob Orton 979c22c3ad parallel assignment is ok
Change-Id: I525ef8ad5cab4f9e3c0da8654fc8b1d817214bb9
Reviewed-on: https://gerrit.instructure.com/62371
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2015-09-03 23:29:02 +00:00
Strand McCutchen e3d836fdb8 turn off Rubocop::Cop::Style::WhileUntilModifier
The modifier while/until construction should not be preferred.

The style guide has been updated to reflect this:
  https://gollum.instructure.com/Ruby-style-guidelines#While/Until

Change-Id: Ib1b8b3cf29d52729ba9d3f9066554fc421d47111
Reviewed-on: https://gerrit.instructure.com/52997
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-28 17:20:55 +00:00