summaryrefslogtreecommitdiff
path: root/db/migrate/20160106162223_add_index_milestones_title.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-06-10 10:38:48 +0000
committerDouwe Maan <douwe@gitlab.com>2016-06-10 10:38:48 +0000
commit0dcd050bf4b30e56247c897c2aac4daeb9aa56dc (patch)
treee89a0701f6255f5284e5c24565ba9f12d51a192f /db/migrate/20160106162223_add_index_milestones_title.rb
parenta9a9f19b0b245a5829b0626d539c81c7cd28d46c (diff)
parent98bb435f4266719b1e0fca57472a0f4e50d30371 (diff)
downloadgitlab-ce-0dcd050bf4b30e56247c897c2aac4daeb9aa56dc.tar.gz
Merge branch 'enable-rubocop-for-migrations' into 'master'
Enable RuboCop for migrations ## What does this MR do? Enable RuboCop for all files inside `db/migrate`, then add magic comments to all existing files, so that this only affects new migrations. ## Are there points in the code the reviewer needs to double check? This entire change is a config change and a bunch of comments. ## Why was this MR needed? ``` Yorick Peterse [11:55 AM] I don't think we have any use case for nested def, might as well blacklist it Sean McGivern [11:57 AM] http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/NestedMethodDefinition Sean McGivern [11:57 AM] hmm, it's already enabled Sean McGivern [11:57 AM] ... because we exclude `db/` from rubocop :slightly_smiling_face: Douwe Maan [11:57 AM] @smcgivern: heh Sean McGivern [11:59 AM] I guess that's because we don't want to change the old migrations? I wonder if it's worth enabling it and adding magic comments to all the previous ones to ignore rubocop Douwe Maan [11:59 AM] @smcgivern: agreed ``` ## What are the relevant issue numbers? None. ## Screenshots (if relevant) None, but if I remove the magic comment from the migration `20160416182152_convert_award_note_to_emoji_award.rb` I get: ``` $ be rubocop Inspecting 1959 files ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................W.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Offenses: db/migrate/20160416182152_convert_award_note_to_emoji_award.rb:3:5: W: Lint/NestedMethodDefinition: Method definitions must not be nested. Use lambda instead. def up ... ^^^^^^ 1959 files inspected, 1 offense detected ``` ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - [ ] Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4559
Diffstat (limited to 'db/migrate/20160106162223_add_index_milestones_title.rb')
-rw-r--r--db/migrate/20160106162223_add_index_milestones_title.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/db/migrate/20160106162223_add_index_milestones_title.rb b/db/migrate/20160106162223_add_index_milestones_title.rb
index 767885e2aac..9b9b6445a08 100644
--- a/db/migrate/20160106162223_add_index_milestones_title.rb
+++ b/db/migrate/20160106162223_add_index_milestones_title.rb
@@ -1,3 +1,4 @@
+# rubocop:disable all
class AddIndexMilestonesTitle < ActiveRecord::Migration
def change
add_index :milestones, :title