]> git.openstreetmap.org Git - rails.git/commitdiff
Standardise on "hash rocket" style for hashes
authorTom Hughes <tom@compton.nu>
Fri, 20 Feb 2015 19:53:13 +0000 (19:53 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 20 Feb 2015 19:53:13 +0000 (19:53 +0000)
.rubocop.yml
.rubocop_todo.yml
Vagrantfile
db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb
test/controllers/geocoder_controller_test.rb

index 555d76d36117bf86fbef9ebb1a26615dc99983ab..a0533b162da42b0d3aebdd7077258226f5d0b1fe 100644 (file)
@@ -9,5 +9,11 @@ Style/FileName:
     - 'script/locale/reload-languages'
     - 'script/update-spam-blocks'
 
     - 'script/locale/reload-languages'
     - 'script/update-spam-blocks'
 
+Style/HashSyntax:
+  EnforcedStyle: hash_rockets
+  Exclude:
+    - 'lib/tasks/testing.rake'
+    - 'config/initializers/wrap_parameters.rb'
+
 Style/StringLiterals:
   EnforcedStyle: double_quotes
 Style/StringLiterals:
   EnforcedStyle: double_quotes
index f43d2ac8cc8d8ed5c75745649c467e46c3efd524..418e7265d05228b0771e945e86d150365608b1ad 100644 (file)
@@ -98,12 +98,6 @@ Style/GlobalVars:
 Style/GuardClause:
   Enabled: false
 
 Style/GuardClause:
   Enabled: false
 
-# Offense count: 5687
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/HashSyntax:
-  Enabled: false
-
 # Offense count: 60
 # Cop supports --auto-correct.
 Style/LineEndConcatenation:
 # Offense count: 60
 # Cop supports --auto-correct.
 Style/LineEndConcatenation:
index 69ec5256ddfe8a5eb2470005a1ffae64a323dbfc..1986dd1d9da336bf1671a30e7013a258bbafe852 100644 (file)
@@ -6,7 +6,7 @@ Vagrant.configure("2") do |config|
   config.vm.box_url = "http://files.vagrantup.com/precise64.box"
 
   # port forward for webrick on 3000
   config.vm.box_url = "http://files.vagrantup.com/precise64.box"
 
   # port forward for webrick on 3000
-  config.vm.network :forwarded_port, guest: 3000, host: 3000
+  config.vm.network :forwarded_port, :guest => 3000, :host => 3000
 
   # set up synced folder to source in /srv/openstreetmap-website
   config.vm.synced_folder ".", "/srv/openstreetmap-website"
 
   # set up synced folder to source in /srv/openstreetmap-website
   config.vm.synced_folder ".", "/srv/openstreetmap-website"
index b6962e7d5123dee5d0c0f3414070470a0592657a..4eab95ce72d737e73e3d541755b3c9b940c7a2fc 100644 (file)
@@ -2,9 +2,9 @@ require "migrate"
 
 class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration
   def change
 
 class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration
   def change
-    create_table :changesets_subscribers, id: false do |t|
-      t.column :subscriber_id, :bigint, null: false
-      t.column :changeset_id, :bigint, null: false
+    create_table :changesets_subscribers, :id => false do |t|
+      t.column :subscriber_id, :bigint, :null => false
+      t.column :changeset_id, :bigint, :null => false
     end
 
     add_foreign_key :changesets_subscribers, :users, :column => :subscriber_id, :name => "changesets_subscribers_subscriber_id_fkey"
     end
 
     add_foreign_key :changesets_subscribers, :users, :column => :subscriber_id, :name => "changesets_subscribers_subscriber_id_fkey"
index 1d2eb87f531a0aba1063035a6848fc4e7e4ca81b..7479b3e9d1cd63802f2a5e5835101aa3dab80746 100644 (file)
@@ -241,7 +241,7 @@ class GeocoderControllerTest < ActionController::TestCase
       "12345",
       "12345-6789"
     ].each do |code|
       "12345",
       "12345-6789"
     ].each do |code|
-      post :search, query: code
+      post :search, :query => code
       assert_response :success
       assert_equal %w(us_postcode osm_nominatim), assigns(:sources)
     end
       assert_response :success
       assert_equal %w(us_postcode osm_nominatim), assigns(:sources)
     end