Skip to content

Commit

Permalink
add .rubocop.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jun 10, 2018
1 parent d128089 commit bc27782
Show file tree
Hide file tree
Showing 87 changed files with 206 additions and 184 deletions.
24 changes: 24 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
AllCops:
TargetRubyVersion: 2.2
Rails:
Enabled: true
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Layout/SpaceInsideBlockBraces:
Enabled: false
Layout/SpaceBeforeBlockBraces:
Enabled: false
Style/WordArray:
Enabled: false
Style/Documentation:
Enabled: false
Style/StringLiterals:
Enabled: false
Style/AsciiComments:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/LineLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
end


task :default => :spec
task default: :spec
4 changes: 2 additions & 2 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class User < ActiveRecord::Base
devise :database_authenticatable, #:registerable,
:recoverable, :rememberable, :trackable, #, :validatable
:lockable, :lock_strategy => :none, :unlock_strategy => :none
:recoverable, :rememberable, :trackable, # , :validatable
:lockable, lock_strategy: :none, unlock_strategy: :none

include EnjuSeed::EnjuUser
include EnjuCirculation::EnjuUser
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ class Application < Rails::Application
config.active_record.raise_in_transactional_callbacks = true
end
end

2 changes: 1 addition & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

config.action_mailer.default_url_options = {:host => 'localhost:3000'}
config.action_mailer.default_url_options = {host: 'localhost:3000'}
end
12 changes: 6 additions & 6 deletions spec/dummy/db/migrate/001_create_agents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def change
t.text :region
t.datetime :date_of_birth
t.datetime :date_of_death
t.integer :language_id, :default => 1, :null => false
t.integer :country_id, :default => 1, :null => false
t.integer :agent_type_id, :default => 1, :null => false
t.integer :lock_version, :default => 0, :null => false
t.integer :language_id, default: 1, null: false
t.integer :country_id, default: 1, null: false
t.integer :agent_type_id, default: 1, null: false
t.integer :lock_version, default: 0, null: false
t.text :note
t.integer :required_role_id, :default => 1, :null => false
t.integer :required_score, :default => 0, :null => false
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
t.text :email
t.text :url
end
Expand Down
10 changes: 5 additions & 5 deletions spec/dummy/db/migrate/002_devise_create_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""

## Recoverable
t.string :reset_password_token
Expand All @@ -13,7 +13,7 @@ def change
t.datetime :remember_created_at

## Trackable
t.integer :sign_in_count, :default => 0
t.integer :sign_in_count, default: 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
Expand All @@ -37,8 +37,8 @@ def change
t.timestamps
end

add_index :users, :email, :unique => true
add_index :users, :reset_password_token, :unique => true
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
# add_index :users, :authentication_token, :unique => true
Expand Down
24 changes: 12 additions & 12 deletions spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateManifestations < ActiveRecord::Migration
def change
create_table :manifestations do |t|
t.text :original_title, :null => false
t.text :original_title, null: false
t.text :title_alternative
t.text :title_transcription
t.string :classification_number
Expand All @@ -11,8 +11,8 @@ def change
t.timestamps
t.datetime :deleted_at
t.string :access_address
t.integer :language_id, :default => 1, :null => false
t.integer :carrier_type_id, :default => 1, :null => false
t.integer :language_id, default: 1, null: false
t.integer :carrier_type_id, default: 1, null: false
t.integer :start_page
t.integer :end_page
t.integer :height
Expand All @@ -25,17 +25,17 @@ def change
t.string :serial_number_string
t.integer :edition
t.text :note
t.boolean :repository_content, :default => false, :null => false
t.integer :lock_version, :default => 0, :null => false
t.integer :required_role_id, :default => 1, :null => false
t.integer :required_score, :default => 0, :null => false
t.integer :frequency_id, :default => 1, :null => false
t.boolean :subscription_master, :default => false, :null => false
t.boolean :repository_content, default: false, null: false
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
t.integer :frequency_id, default: 1, null: false
t.boolean :subscription_master, default: false, null: false
end
#add_index :manifestations, :carrier_type_id
#add_index :manifestations, :required_role_id
# add_index :manifestations, :carrier_type_id
# add_index :manifestations, :required_role_id
add_index :manifestations, :access_address
#add_index :manifestations, :frequency_id
# add_index :manifestations, :frequency_id
add_index :manifestations, :manifestation_identifier
add_index :manifestations, :updated_at
add_index :manifestations, :date_of_publication
Expand Down
10 changes: 5 additions & 5 deletions spec/dummy/db/migrate/006_create_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ def change
t.string :item_identifier
t.timestamps
t.datetime :deleted_at
t.integer :shelf_id, :default => 1, :null => false
t.boolean :include_supplements, :default => false, :null => false
t.integer :shelf_id, default: 1, null: false
t.boolean :include_supplements, default: false, null: false
t.text :note
t.string :url
t.integer :price
t.integer :lock_version, :default => 0, :null => false
t.integer :required_role_id, :default => 1, :null => false
t.integer :required_score, :default => 0, :null => false
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
end
add_index :items, :shelf_id
add_index :items, :item_identifier
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/012_create_owns.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateOwns < ActiveRecord::Migration
def change
create_table :owns do |t|
t.references :agent, :null => false
t.references :item, :null => false
t.references :agent, null: false
t.references :item, null: false
t.integer :position
t.timestamps
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/015_create_creates.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateCreates < ActiveRecord::Migration
def change
create_table :creates do |t|
t.references :agent, :null => false
t.references :work, :null => false
t.references :agent, null: false
t.references :work, null: false
t.integer :position
t.timestamps
end
Expand Down
6 changes: 3 additions & 3 deletions spec/dummy/db/migrate/029_create_subjects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ def self.up
t.integer :use_term_id
t.string :term
t.text :term_transcription
t.integer :subject_type_id, :null => false
t.integer :subject_type_id, null: false
t.text :scope_note
t.text :note
t.integer :required_role_id, :default => 1, :null => false
t.integer :lock_version, :default => 0, :null => false
t.integer :required_role_id, default: 1, null: false
t.integer :lock_version, default: 0, null: false
t.datetime :created_at
t.datetime :updated_at
t.datetime :deleted_at
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/032_create_checkins.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateCheckins < ActiveRecord::Migration
def self.up
create_table :checkins do |t|
t.integer :item_id, :null => false
t.integer :item_id, null: false
t.integer :librarian_id
t.integer :basket_id
t.timestamps
Expand Down
8 changes: 4 additions & 4 deletions spec/dummy/db/migrate/033_create_checkouts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ class CreateCheckouts < ActiveRecord::Migration
def self.up
create_table :checkouts do |t|
t.integer :user_id
t.integer :item_id, :null => false
t.integer :item_id, null: false
t.integer :checkin_id
t.integer :librarian_id
t.integer :basket_id
t.datetime :due_date
t.integer :checkout_renewal_count, :default => 0, :null => false
t.integer :lock_version, :default => 0, :null => false
t.integer :checkout_renewal_count, default: 0, null: false
t.integer :lock_version, default: 0, null: false
t.timestamps
end
add_index :checkouts, :user_id
add_index :checkouts, :item_id
add_index :checkouts, :basket_id
add_index :checkouts, [:item_id, :basket_id], :unique => true
add_index :checkouts, [:item_id, :basket_id], unique: true
add_index :checkouts, :librarian_id
add_index :checkouts, :checkin_id
end
Expand Down
10 changes: 5 additions & 5 deletions spec/dummy/db/migrate/035_create_reserves.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
class CreateReserves < ActiveRecord::Migration
def self.up
create_table :reserves do |t|
t.integer :user_id, :null => false
t.integer :manifestation_id, :null => false
t.integer :user_id, null: false
t.integer :manifestation_id, null: false
t.integer :item_id
t.integer :request_status_type_id, :null => false
t.integer :request_status_type_id, null: false
t.datetime :checked_out_at
t.timestamps
t.datetime :canceled_at
t.datetime :expired_at
t.datetime :deleted_at
t.boolean :expiration_notice_to_patron, :default => false
t.boolean :expiration_notice_to_library, :default => false
t.boolean :expiration_notice_to_patron, default: false
t.boolean :expiration_notice_to_library, default: false
end

add_index :reserves, :user_id
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/041_create_roles.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class CreateRoles < ActiveRecord::Migration
def change
create_table "roles" do |t|
t.column :name, :string, :null => false
t.column :name, :string, null: false
t.column :display_name, :string
t.column :note, :text
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.integer :score, :default => 0, :null => false
t.integer :score, default: 0, null: false
t.integer :position
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/047_create_produces.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateProduces < ActiveRecord::Migration
def change
create_table :produces do |t|
t.references :agent, :null => false
t.references :manifestation, :null => false
t.references :agent, null: false
t.references :manifestation, null: false
t.integer :position
t.timestamps
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/055_create_bookmarks.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateBookmarks < ActiveRecord::Migration
def self.up
create_table :bookmarks, :force => true do |t|
t.integer :user_id, :null => false
create_table :bookmarks, force: true do |t|
t.integer :user_id, null: false
t.integer :manifestation_id
t.text :title
t.string :url
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/073_create_carrier_types.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateCarrierTypes < ActiveRecord::Migration
def change
create_table :carrier_types do |t|
t.string :name, :null => false
t.string :name, null: false
t.text :display_name
t.text :note
t.integer :position
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/077_create_user_groups.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateUserGroups < ActiveRecord::Migration
def change
create_table :user_groups do |t|
t.string :name, :not_null => true
t.string :name, not_null: true
t.text :display_name
t.text :note
t.integer :position
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/112_create_frequencies.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateFrequencies < ActiveRecord::Migration
def change
create_table :frequencies do |t|
t.string :name, :null => false
t.string :name, null: false
t.text :display_name
t.text :note
t.integer :position
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/117_create_form_of_works.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateFormOfWorks < ActiveRecord::Migration
def change
create_table :form_of_works do |t|
t.string :name, :null => false
t.string :name, null: false
t.text :display_name
t.text :note
t.integer :position
Expand Down
6 changes: 3 additions & 3 deletions spec/dummy/db/migrate/121_create_checked_items.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class CreateCheckedItems < ActiveRecord::Migration
def self.up
create_table :checked_items do |t|
t.integer :item_id, :null => false
t.integer :basket_id, :null => false
t.datetime :due_date, :null => false
t.integer :item_id, null: false
t.integer :basket_id, null: false
t.datetime :due_date, null: false

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/124_create_bookstores.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateBookstores < ActiveRecord::Migration
def change
create_table :bookstores do |t|
t.text :name, :null => false
t.text :name, null: false
t.string :zip_code
t.text :address
t.text :note
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/125_create_donates.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateDonates < ActiveRecord::Migration
def change
create_table :donates do |t|
t.integer :agent_id, :null => false
t.integer :item_id, :null => false
t.integer :agent_id, null: false
t.integer :item_id, null: false

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/127_create_use_restrictions.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateUseRestrictions < ActiveRecord::Migration
def self.up
create_table :use_restrictions do |t|
t.string :name, :null => false
t.string :name, null: false
t.text :display_name
t.text :note
t.integer :position
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateItemHasUseRestrictions < ActiveRecord::Migration
def self.up
create_table :item_has_use_restrictions do |t|
t.integer :item_id, :null => false
t.integer :use_restriction_id, :null => false
t.integer :item_id, null: false
t.integer :use_restriction_id, null: false

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/130_create_request_status_types.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateRequestStatusTypes < ActiveRecord::Migration
def change
create_table :request_status_types do |t|
t.string :name, :null => false
t.string :name, null: false
t.text :display_name
t.text :note
t.integer :position
Expand Down
Loading

0 comments on commit bc27782

Please sign in to comment.