Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Update directories excluded by rubocop (#1096)
Browse files Browse the repository at this point in the history
* Update directories excluded by rubocop

By excluding the `log` and `tmp` directories, we can speed up the local
execution of rubocop a bit. Over the time, especially the `tmp`
directory collects loads of files (e.g. from letter_opener) and we want
to spare rubocop having to dig through all of them.

* Attempt to merge excludes

* A different attempt on merging the excludes

* Remove deprecated cop

This cop used to report false positives.

* Inherit Rubocop's default exclude list

* Update Rubocop

We were on a "difficult" version 😉
Also: include some quick drive-by fixes.
  • Loading branch information
klappradla committed Jan 28, 2019
1 parent ee164fc commit dee0319
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
12 changes: 9 additions & 3 deletions .rubocop.yml
@@ -1,10 +1,16 @@
require: rubocop-rspec

inherit_from: .rubocop_todo.yml
inherit_from:
- .rubocop_todo.yml

inherit_mode:
merge:
- Exclude

AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- 'tmp/**/*'
- 'log/**/*'

Rails:
Enabled: true
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Expand Up @@ -230,13 +230,6 @@ Lint/ShadowingOuterLocalVariable:
- 'app/helpers/application_helper.rb'
- 'lib/feed.rb'

# Offense count: 3
Lint/SplatKeywordArguments:
Exclude:
- 'spec/mailers/application_form_mailer_spec.rb'
- 'spec/models/conference_preference_spec.rb'
- 'spec/models/conference_spec.rb'

# Offense count: 1
Lint/UnderscorePrefixedVariableName:
Exclude:
Expand Down
14 changes: 8 additions & 6 deletions Gemfile.lock
Expand Up @@ -149,6 +149,7 @@ GEM
i18n (1.0.1)
concurrent-ruby (~> 1.0)
i18n_data (0.8.0)
jaro_winkler (1.5.2)
jmespath (1.4.0)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
Expand Down Expand Up @@ -212,11 +213,11 @@ GEM
oauth2 (~> 1.1)
omniauth (~> 1.2)
orm_adapter (0.5.0)
parallel (1.12.1)
parser (2.5.1.0)
parallel (1.13.0)
parser (2.6.0.0)
ast (~> 2.4.0)
pg (1.0.0)
powerpack (0.1.1)
powerpack (0.1.2)
pretender (0.3.2)
actionpack
pry (0.11.3)
Expand Down Expand Up @@ -299,7 +300,8 @@ GEM
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.56.0)
rubocop (0.57.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
Expand All @@ -308,7 +310,7 @@ GEM
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-rspec (1.27.0)
rubocop (>= 0.56.0)
ruby-progressbar (1.9.0)
ruby-progressbar (1.10.0)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.5.6)
Expand Down Expand Up @@ -368,7 +370,7 @@ GEM
thread_safe (~> 0.1)
uglifier (4.1.10)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.2)
unicode-display_width (1.4.1)
unicode_utils (1.4.0)
warden (1.2.7)
rack (>= 1.0)
Expand Down
14 changes: 5 additions & 9 deletions app/services/conference_importer.rb
Expand Up @@ -13,22 +13,18 @@ class ConferenceImporter
# - Import errors are logged in a Rails Logger
# - UID is mapped to 'gid' ('google-id' LOL), and has the format: 2017001

class << self
def call(filename, content_type:)
raise ArgumentError, "Oops! I can upload .csv only :-(" unless content_type == "text/csv"
new(filename)
end

private :new
def self.call(filename, content_type:)
raise ArgumentError, "Oops! I can upload .csv only :-(" unless content_type == "text/csv"
new(filename)
end

private

def initialize(filename)
@filename = filename
with_log { process_csv }
end

private

attr_reader :filename

def with_log
Expand Down
@@ -1,4 +1,3 @@

class RenameAttendanceToConferencePreference < ActiveRecord::Migration[5.1]
def self.up
rename_table :attendances, :conference_preferences
Expand Down

0 comments on commit dee0319

Please sign in to comment.