mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1471 from nasia-sam/rubocop_string_array
Add Style/WordArray at rubocop.yml #1463
This commit is contained in:
commit
08e5f10559
6 changed files with 8 additions and 12 deletions
|
|
@ -104,6 +104,10 @@ Style/TrailingBlankLines:
|
|||
Style/TrailingWhitespace:
|
||||
Enabled: true
|
||||
|
||||
# Check for array literals made up of word-like strings, that are not using the %w() syntax
|
||||
Style/WordArray:
|
||||
Enabled: true
|
||||
|
||||
# This cop checks for numeric comparisons that can be replaced by a predicate method.
|
||||
Style/ZeroLengthPredicate:
|
||||
Enabled: true
|
||||
|
|
|
|||
|
|
@ -928,11 +928,3 @@ Style/UnneededInterpolation:
|
|||
Style/VariableNumber:
|
||||
Exclude:
|
||||
- 'spec/models/ticket_purchase_spec.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: SupportedStyles, WordRegex.
|
||||
# SupportedStyles: percent, brackets
|
||||
Style/WordArray:
|
||||
EnforcedStyle: percent
|
||||
MinSize: 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class EventUser < ActiveRecord::Base
|
||||
# TODO Do we need these roles?
|
||||
ROLES = [['Speaker', 'speaker'], ['Submitter', 'submitter'], ['Moderator', 'moderator']]
|
||||
ROLES = [%w[Speaker speaker], %w[Submitter submitter], %w[Moderator moderator]]
|
||||
|
||||
belongs_to :event
|
||||
belongs_to :user
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ namespace :data do
|
|||
desc 'Sets conference_id in all pre-existing PaperTrail::Version objects'
|
||||
task set_conference_in_versions: :environment do
|
||||
|
||||
PaperTrail::Version.where(conference_id: nil, item_type: ['Conference', 'Event']).each do |version|
|
||||
PaperTrail::Version.where(conference_id: nil, item_type: %w[Conference Event]).each do |version|
|
||||
# All pre-existing versions are either of Conference or Event
|
||||
if version.item_type == 'Conference'
|
||||
version.update_attributes(conference_id: version.item_id)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ describe UsersHelper, type: :helper do
|
|||
|
||||
describe 'show_roles' do
|
||||
it 'formats the hash passed' do
|
||||
roles = { 'organizer' => ['oSC16', 'oSC15'], 'cfp' => ['oSC16'] }
|
||||
roles = { 'organizer' => %w[oSC16 oSC15], 'cfp' => ['oSC16'] }
|
||||
expect(show_roles(roles)).to eq 'Organizer (oSC16, oSC15), Cfp (oSC16)'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ describe User do
|
|||
|
||||
it 'returns hash of role and conference' do
|
||||
expected_hash = {
|
||||
'organizer' => ['oSC16', 'oSC15'],
|
||||
'organizer' => %w[oSC16 oSC15],
|
||||
'cfp' => ['oSC16']
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue