Skip to content

Commit

Permalink
Merge pull request #245 from metricfu/rubocop
Browse files Browse the repository at this point in the history
Rubocop cleanup
  • Loading branch information
bf4 committed Feb 27, 2015
2 parents c00707e + 35387b4 commit 3c9d982
Show file tree
Hide file tree
Showing 175 changed files with 1,893 additions and 1,827 deletions.
15 changes: 15 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
inherit_from:
- config/rubocop.yml
- .rubocop_todo.yml

# Files you want to exclude
AllCops:
Exclude:
- bin/*
- gem_tasks/*
- lib/tasks/*
- Gemfile
- Rakefile
- bundle/**/*
- vendor/bundle/**/*
- spec/fixtures/line_numbers/*
69 changes: 69 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-01-27 12:05:28 -0600 using RuboCop version 0.28.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Configuration parameters: AlignWith, SupportedStyles.
Lint/EndAlignment:
Enabled: false

# Offense count: 2
Lint/EnsureReturn:
Enabled: false

# Offense count: 1
Lint/RescueException:
Enabled: false

# Offense count: 10
Lint/ShadowingOuterLocalVariable:
Enabled: false

# Offense count: 1
Lint/UselessAccessModifier:
Enabled: false

# Offense count: 27
Lint/UselessAssignment:
Enabled: false

# Offense count: 44
Metrics/AbcSize:
Max: 56

# Offense count: 393
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 709

# Offense count: 3
Metrics/PerceivedComplexity:
Max: 13

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/AndOr:
Enabled: false

# Offense count: 2
Style/EmptyElse:
Enabled: false

# Offense count: 2
# Configuration parameters: NamePrefix, NamePrefixBlacklist.
Style/PredicateName:
Enabled: false

# Offense count: 1
Style/RescueModifier:
Enabled: false

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Style/Semicolon:
Enabled: false
42 changes: 22 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
# encoding: utf-8
source 'https://rubygems.org'
source "https://rubygems.org"

if RUBY_VERSION == '1.9.2'
if RUBY_VERSION == "1.9.2"
# because of https://github.com/railsbp/rails_best_practices/blob/master/rails_best_practices.gemspec
gem 'activesupport', '~> 3.2'
gem "activesupport", "~> 3.2"
# because of https://github.com/troessner/reek/issues/334
gem 'reek', '~> 1.4.0'
gem "reek", "~> 1.4.0"
# rbp -> as -> i18n
gem 'i18n', '0.6.11'
gem "parallel", "= 1.3.3" # 1.3.4 disallows 1.9.2
else
gem "rubocop", platforms: :mri, groups: [:test, :local_development]
end

gemspec :path => File.expand_path('..', __FILE__)
gemspec path: File.expand_path("..", __FILE__)

platform :jruby do
group :jruby do
gem 'jruby-openssl', '~> 0.8.5'
gem "jruby-openssl", "~> 0.8.5"
end
end

group :test, :local_development do
gem 'pry'
gem 'pry-nav'
gem "pry"
gem "pry-nav"
end

# Added by devtools
group :development do
gem 'rake', '~> 10.1.0'
gem 'yard', '~> 0.8.7', group: :yard
gem "rake", "~> 10.1.0"
gem "yard", "~> 0.8.7", group: :yard
end

group :guard do
gem 'guard', '~> 1.8.1'
gem 'guard-bundler', '~> 1.0.0'
gem 'guard-rspec'
gem "guard", "~> 1.8.1"
gem "guard-bundler", "~> 1.0.0"
gem "guard-rspec"

# file system change event handling
gem 'listen', '~> 1.3.0'
gem 'rb-fchange', '~> 0.0.6', require: false
gem 'rb-fsevent', '~> 0.9.3', require: false
gem 'rb-inotify', '~> 0.9.0', require: false
gem "listen", "~> 1.3.0"
gem "rb-fchange", "~> 0.0.6", require: false
gem "rb-fsevent", "~> 0.9.3", require: false
gem "rb-inotify", "~> 0.9.0", require: false

# notification handling
gem 'libnotify', '~> 0.8.0', require: false
gem 'rb-notifu', '~> 0.0.4', require: false
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
gem "libnotify", "~> 0.8.0", require: false
gem "rb-notifu", "~> 0.0.4", require: false
gem "terminal-notifier-guard", "~> 1.5.3", require: false
end
18 changes: 9 additions & 9 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
guard :bundler do
watch('Gemfile')
watch('Gemfile.lock')
watch("Gemfile")
watch("Gemfile.lock")
watch(%w{.+.gemspec\z})
end

guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
guard :rspec, cli: File.read(".rspec").split.push("--fail-fast").join(" "), keep_failed: false do
# Run all specs if configuration is modified
watch('.rspec') { 'spec' }
watch('Guardfile') { 'spec' }
watch('Gemfile.lock') { 'spec' }
watch('spec/spec_helper.rb') { 'spec' }
watch(".rspec") { "spec" }
watch("Guardfile") { "spec" }
watch("Gemfile.lock") { "spec" }
watch("spec/spec_helper.rb") { "spec" }

# Run all specs if supporting files are modified
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { "spec" }

# Run unit specs if associated lib code is modified
watch(%r{\Alib/(.+)\.rb\z}) { |m| "spec/#{m[1]}_spec.rb" }
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { "spec" }

# Run a spec if it is modified
watch(%r{\Aspec/.+_spec\.rb$\z})
Expand Down
Loading

0 comments on commit 3c9d982

Please sign in to comment.