From bbc19a54363a7a24bad4de58563a697da0d17fdd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 26 Nov 2016 11:49:51 +1300 Subject: [PATCH] Array indentation fixed --- .rubocop_todo.yml | 7 ---- app/controllers/members_controller.rb | 8 ++-- app/controllers/places_controller.rb | 8 ++-- spec/rails_helper.rb | 6 +-- spec/views/comments/index.html.haml_spec.rb | 6 +-- spec/views/comments/index.rss.haml_spec.rb | 6 +-- spec/views/harvests/index.html.haml_spec.rb | 20 +++++----- spec/views/photos/index.html.haml_spec.rb | 6 +-- spec/views/plantings/index.html.haml_spec.rb | 38 +++++++++---------- spec/views/posts/index.html.haml_spec.rb | 6 +-- spec/views/roles/index.html.haml_spec.rb | 18 ++++----- .../scientific_names/index.html.haml_spec.rb | 6 +-- 12 files changed, 64 insertions(+), 71 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8a8587b5c..04a33c017 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1122,13 +1122,6 @@ Style/IfUnlessModifier: - 'config/initializers/geocoder.rb' - 'lib/tasks/growstuff.rake' -# Offense count: 18 -# Cop supports --auto-correct. -# Configuration parameters: SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_brackets -Style/IndentArray: - EnforcedStyle: consistent - # Offense count: 24 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 4fecee7f1..d13a5e843 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -17,8 +17,8 @@ class MembersController < ApplicationController format.html # index.html.haml format.json { render json: @members.to_json(only: [ - :id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude + ]) } end end @@ -38,8 +38,8 @@ class MembersController < ApplicationController format.html # show.html.haml format.json { render json: @member.to_json(only: [ - :id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude + ]) } format.rss { render( layout: false, diff --git a/app/controllers/places_controller.rb b/app/controllers/places_controller.rb index 2f7331b3a..b91e093d5 100644 --- a/app/controllers/places_controller.rb +++ b/app/controllers/places_controller.rb @@ -7,8 +7,8 @@ class PlacesController < ApplicationController # json response is whatever we want to map here format.json do render json: Member.located.to_json(only: [ - :id, :login_name, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :location, :latitude, :longitude + ]) end end end @@ -22,8 +22,8 @@ class PlacesController < ApplicationController format.html # show.html.haml format.json do render json: @nearby_members.to_json(only: [ - :id, :login_name, :slug, :location, :latitude, :longitude - ]) + :id, :login_name, :slug, :location, :latitude, :longitude + ]) end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c9ab1e79e..5ec7f100a 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -5,9 +5,9 @@ require 'coveralls' # output coverage locally AND send it to coveralls SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -]) + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ]) # fail if there's a significant test coverage drop SimpleCov.maximum_coverage_drop 1 diff --git a/spec/views/comments/index.html.haml_spec.rb b/spec/views/comments/index.html.haml_spec.rb index e0eb907cc..69d9a4d88 100644 --- a/spec/views/comments/index.html.haml_spec.rb +++ b/spec/views/comments/index.html.haml_spec.rb @@ -24,9 +24,9 @@ describe "comments/index" do total_entries = 2 comments = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:comment), - FactoryGirl.create(:comment, body: 'ROFL') - ]) + FactoryGirl.create(:comment), + FactoryGirl.create(:comment, body: 'ROFL') + ]) end assign(:comments, comments) render diff --git a/spec/views/comments/index.rss.haml_spec.rb b/spec/views/comments/index.rss.haml_spec.rb index f2fe2c4d9..f656ec90c 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -22,9 +22,9 @@ describe 'comments/index.rss.haml' do @author = FactoryGirl.create(:member) @post = FactoryGirl.create(:post) assign(:comments, [ - FactoryGirl.create(:comment, author: @author, post: @post), - FactoryGirl.create(:comment, author: @author, post: @post) - ]) + FactoryGirl.create(:comment, author: @author, post: @post), + FactoryGirl.create(:comment, author: @author, post: @post) + ]) render end diff --git a/spec/views/harvests/index.html.haml_spec.rb b/spec/views/harvests/index.html.haml_spec.rb index 0e86f9782..cacf6b551 100644 --- a/spec/views/harvests/index.html.haml_spec.rb +++ b/spec/views/harvests/index.html.haml_spec.rb @@ -28,16 +28,16 @@ describe "harvests/index" do total_entries = 2 harvests = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:harvest, - crop: @tomato, - owner: @member - ), - FactoryGirl.create(:harvest, - crop: @maize, - plant_part: @pp, - owner: @member - ) - ]) + FactoryGirl.create(:harvest, + crop: @tomato, + owner: @member + ), + FactoryGirl.create(:harvest, + crop: @maize, + plant_part: @pp, + owner: @member + ) + ]) end assign(:harvests, harvests) render diff --git a/spec/views/photos/index.html.haml_spec.rb b/spec/views/photos/index.html.haml_spec.rb index 7b7479c97..bf8624665 100644 --- a/spec/views/photos/index.html.haml_spec.rb +++ b/spec/views/photos/index.html.haml_spec.rb @@ -23,9 +23,9 @@ describe "photos/index" do total_entries = 2 photos = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:photo), - FactoryGirl.create(:photo) - ]) + FactoryGirl.create(:photo), + FactoryGirl.create(:photo) + ]) end assign(:photos, photos) end diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index 0b584562f..7abf2a087 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -28,25 +28,25 @@ describe "plantings/index" do total_entries = 3 plantings = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:planting, - garden: @garden, - crop: @tomato, - owner: @member - ), - FactoryGirl.create(:planting, - garden: @garden, - crop: @maize, - description: '', - planted_at: Time.local(2013, 1, 13) - ), - FactoryGirl.create(:planting, - garden: @garden, - crop: @tomato, - planted_at: Time.local(2013, 1, 13), - finished_at: Time.local(2013, 1, 20), - finished: true - ) - ]) + FactoryGirl.create(:planting, + garden: @garden, + crop: @tomato, + owner: @member + ), + FactoryGirl.create(:planting, + garden: @garden, + crop: @maize, + description: '', + planted_at: Time.local(2013, 1, 13) + ), + FactoryGirl.create(:planting, + garden: @garden, + crop: @tomato, + planted_at: Time.local(2013, 1, 13), + finished_at: Time.local(2013, 1, 20), + finished: true + ) + ]) end assign(:plantings, plantings) render diff --git a/spec/views/posts/index.html.haml_spec.rb b/spec/views/posts/index.html.haml_spec.rb index 3d0f094d6..da6948168 100644 --- a/spec/views/posts/index.html.haml_spec.rb +++ b/spec/views/posts/index.html.haml_spec.rb @@ -25,9 +25,9 @@ describe "posts/index" do total_entries = 2 posts = WillPaginate::Collection.create(page, per_page, total_entries) do |pager| pager.replace([ - FactoryGirl.create(:post, author: @author), - FactoryGirl.create(:post, author: @author) - ]) + FactoryGirl.create(:post, author: @author), + FactoryGirl.create(:post, author: @author) + ]) end assign(:posts, posts) render diff --git a/spec/views/roles/index.html.haml_spec.rb b/spec/views/roles/index.html.haml_spec.rb index be7fd4795..bb4fbdd9e 100644 --- a/spec/views/roles/index.html.haml_spec.rb +++ b/spec/views/roles/index.html.haml_spec.rb @@ -20,15 +20,15 @@ describe "roles/index" do before(:each) do controller.stub(:current_user) { nil } assign(:roles, [ - stub_model(Role, - name: "Name", - description: "MyText" - ), - stub_model(Role, - name: "Name", - description: "MyText" - ) - ]) + stub_model(Role, + name: "Name", + description: "MyText" + ), + stub_model(Role, + name: "Name", + description: "MyText" + ) + ]) end it "renders a list of roles" do diff --git a/spec/views/scientific_names/index.html.haml_spec.rb b/spec/views/scientific_names/index.html.haml_spec.rb index 64d5cb521..ceda2cb87 100644 --- a/spec/views/scientific_names/index.html.haml_spec.rb +++ b/spec/views/scientific_names/index.html.haml_spec.rb @@ -20,9 +20,9 @@ describe "scientific_names/index" do before(:each) do controller.stub(:current_user) { nil } assign(:scientific_names, [ - FactoryGirl.create(:zea_mays), - FactoryGirl.create(:solanum_lycopersicum) - ]) + FactoryGirl.create(:zea_mays), + FactoryGirl.create(:solanum_lycopersicum) + ]) end it "renders a list of scientific_names" do