Skip to content

Commit

Permalink
Update linting to match houndci.com's
Browse files Browse the repository at this point in the history
*Updated rubocop for better linting
*Fixed any issues raised by rubocop
*Updated style config from houndci.com, keeping Montreal.rb's
modifications
  • Loading branch information
steakunderscore committed Mar 4, 2016
1 parent 80c6700 commit a6125c4
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 68 deletions.
16 changes: 13 additions & 3 deletions .ruby-style.yml
Expand Up @@ -119,13 +119,23 @@ Style/StringLiteralsInInterpolation:
SupportedStyles:
- single_quotes
- double_quotes
Style/TrailingComma:
Description: Checks for trailing comma in parameter lists and literals.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
Enabled: false
EnforcedStyleForMultiline: no_comma
SupportedStyles:
- comma
- consistent_comma
- no_comma
Style/TrailingCommaInLiteral:
Description: 'Checks for trailing comma in array and hash literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
Enabled: false
EnforcedStyleForMultiline: no_comma
SupportedStyles:
- comma
- consistent_comma
- no_comma
Metrics/AbcSize:
Description: A calculated magnitude based on number of assignments, branches, and
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/company_dashboard.rb
Expand Up @@ -14,8 +14,8 @@ class CompanyDashboard < Administrate::BaseDashboard
address: Field::String,
logo: Field::String,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -26,8 +26,8 @@ class CompanyDashboard < Administrate::BaseDashboard
:translations,
:id,
:name,
:address,
]
:address
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -40,8 +40,8 @@ class CompanyDashboard < Administrate::BaseDashboard
:translations,
:name,
:address,
:logo,
]
:logo
].freeze

# Overwrite this method to customize how companies are displayed
# across all pages of the admin dashboard.
Expand Down
2 changes: 1 addition & 1 deletion app/dashboards/dashboard_manifest.rb
Expand Up @@ -16,7 +16,7 @@ class DashboardManifest
:events,
:organizations,
:pages
]
].freeze

# `ROOT_DASHBOARD`
# the name of the dashboard that will be displayed
Expand Down
10 changes: 5 additions & 5 deletions app/dashboards/event_dashboard.rb
Expand Up @@ -16,7 +16,7 @@ class EventDashboard < Administrate::BaseDashboard
title: Field::String,
introduction: Field::Text,
conclusion: Field::Text
}
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -27,8 +27,8 @@ class EventDashboard < Administrate::BaseDashboard
:id,
:title,
:starts_at,
:location,
]
:location
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -42,8 +42,8 @@ class EventDashboard < Administrate::BaseDashboard
:introduction,
:conclusion,
:starts_at,
:location,
]
:location
].freeze

# Overwrite this method to customize how events are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/job_dashboard.rb
Expand Up @@ -14,8 +14,8 @@ class JobDashboard < Administrate::BaseDashboard
state: EnumField,
description: Field::Text,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -26,8 +26,8 @@ class JobDashboard < Administrate::BaseDashboard
:id,
:state,
:title,
:description,
]
:description
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -39,8 +39,8 @@ class JobDashboard < Administrate::BaseDashboard
FORM_ATTRIBUTES = [
:state,
:title,
:description,
]
:description
].freeze

# Overwrite this method to customize how locations are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/location_dashboard.rb
Expand Up @@ -14,8 +14,8 @@ class LocationDashboard < Administrate::BaseDashboard
address: Field::Text,
url: Field::String,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -26,8 +26,8 @@ class LocationDashboard < Administrate::BaseDashboard
:translations,
:id,
:name,
:address,
]
:address
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -39,8 +39,8 @@ class LocationDashboard < Administrate::BaseDashboard
FORM_ATTRIBUTES = [
:name,
:address,
:url,
]
:url
].freeze

# Overwrite this method to customize how locations are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/meetup_dashboard.rb
Expand Up @@ -14,8 +14,8 @@ class MeetupDashboard < Administrate::BaseDashboard
type: Field::String,
starts_at: Field::DateTime,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -26,8 +26,8 @@ class MeetupDashboard < Administrate::BaseDashboard
:location,
:translations,
:id,
:type,
]
:type
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -40,8 +40,8 @@ class MeetupDashboard < Administrate::BaseDashboard
:location,
:translations,
:type,
:starts_at,
]
:starts_at
].freeze

# Overwrite this method to customize how meetups are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/news_item_dashboard.rb
Expand Up @@ -15,8 +15,8 @@ class NewsItemDashboard < Administrate::BaseDashboard
state: EnumField,
published_at: Field::DateTime,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -28,8 +28,8 @@ class NewsItemDashboard < Administrate::BaseDashboard
:title,
:state,
:updated_at,
:published_at,
]
:published_at
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -42,8 +42,8 @@ class NewsItemDashboard < Administrate::BaseDashboard
:title,
:body,
:state,
:published_at,
]
:published_at
].freeze

# Overwrite this method to customize how news items are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/organization_dashboard.rb
Expand Up @@ -14,8 +14,8 @@ class OrganizationDashboard < Administrate::BaseDashboard
logo: Field::String,
description: Field::Text,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -25,8 +25,8 @@ class OrganizationDashboard < Administrate::BaseDashboard
COLLECTION_ATTRIBUTES = [
:id,
:name,
:address,
]
:address
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -39,8 +39,8 @@ class OrganizationDashboard < Administrate::BaseDashboard
:name,
:address,
:logo,
:description,
]
:description
].freeze

# Overwrite this method to customize how organizations are displayed
# across all pages of the admin dashboard.
Expand Down
8 changes: 4 additions & 4 deletions app/dashboards/page_dashboard.rb
Expand Up @@ -14,7 +14,7 @@ class PageDashboard < Administrate::BaseDashboard
state: EnumField,
created_at: Field::DateTime,
updated_at: Field::DateTime
}
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -26,7 +26,7 @@ class PageDashboard < Administrate::BaseDashboard
:title,
:body,
:state
]
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -38,8 +38,8 @@ class PageDashboard < Administrate::BaseDashboard
FORM_ATTRIBUTES = [
:title,
:body,
:state,
]
:state
].freeze

# Overwrite this method to customize how Pages are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/talk_dashboard.rb
Expand Up @@ -17,8 +17,8 @@ class TalkDashboard < Administrate::BaseDashboard
slides: Field::String,
author_id: Field::Number,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -29,8 +29,8 @@ class TalkDashboard < Administrate::BaseDashboard
:votes,
:author,
:id,
:title,
]
:title
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -46,8 +46,8 @@ class TalkDashboard < Administrate::BaseDashboard
:description,
:bio,
:slides,
:author_id,
]
:author_id
].freeze

# Overwrite this method to customize how talks are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/user_dashboard.rb
Expand Up @@ -22,8 +22,8 @@ class UserDashboard < Administrate::BaseDashboard
last_sign_in_ip: Field::String.with_options(searchable: false),
created_at: Field::DateTime,
updated_at: Field::DateTime,
bio: Field::String,
}
bio: Field::String
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -34,8 +34,8 @@ class UserDashboard < Administrate::BaseDashboard
:votes,
:id,
:email,
:encrypted_password,
]
:encrypted_password
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -56,8 +56,8 @@ class UserDashboard < Administrate::BaseDashboard
:last_sign_in_at,
:current_sign_in_ip,
:last_sign_in_ip,
:bio,
]
:bio
].freeze

# Overwrite this method to customize how users are displayed
# across all pages of the admin dashboard.
Expand Down
12 changes: 6 additions & 6 deletions app/dashboards/vote_dashboard.rb
Expand Up @@ -12,8 +12,8 @@ class VoteDashboard < Administrate::BaseDashboard
user: Field::BelongsTo,
id: Field::Number,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}
updated_at: Field::DateTime
}.freeze

# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
Expand All @@ -24,8 +24,8 @@ class VoteDashboard < Administrate::BaseDashboard
:votable,
:user,
:id,
:created_at,
]
:created_at
].freeze

# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
Expand All @@ -36,8 +36,8 @@ class VoteDashboard < Administrate::BaseDashboard
# on the model's form (`new` and `edit`) pages.
FORM_ATTRIBUTES = [
:votable,
:user,
]
:user
].freeze

# Overwrite this method to customize how votes are displayed
# across all pages of the admin dashboard.
Expand Down
1 change: 0 additions & 1 deletion app/models/job.rb
@@ -1,6 +1,5 @@
class Job < ActiveRecord::Base
extend Enumerize

STATES = %w(draft published archived).freeze

belongs_to :organization
Expand Down

0 comments on commit a6125c4

Please sign in to comment.