Skip to content

Commit

Permalink
Run rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Suschlik committed Feb 9, 2015
1 parent 2269897 commit 7abb42c
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 11 deletions.
63 changes: 63 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generated by `rubocop --auto-gen-config`
inherit_from: .rubocop_todo.yml

# It’s quite readable when we know what we are doing
Lint/AssignmentInCondition:
Enabled: false

# No need to handle LoadError in rake
Lint/HandleExceptions:
Exclude:
- rakelib/*.rake

# The enforced style doesn’t match Vim’s defaults
Style/AlignParameters:
Enabled: false

# UTF-8 is perfectly fine in comments
Style/AsciiComments:
Enabled: false

# Allow using braces for value-returning blocks
Style/Blocks:
Enabled: false

# Documentation checked by Inch CI
Style/Documentation:
Enabled: false

# Early returns have their vices
Style/GuardClause:
Enabled: false

# Need to be skipped for >-> usage
Style/Lambda:
Enabled: false

# Multiline block chains are ok
Style/MultilineBlockChain:
Enabled: false

# Even a single escaped slash can be confusing
Style/RegexpLiteral:
MaxSlashes: 0

# Don’t introduce semantic fail/raise distinction
Style/SignalException:
EnforcedStyle: only_raise

# Need to be skipped for >-> usage
Style/SpaceAroundOperators:
Enabled: false

# Accept both single and double quotes
Style/StringLiterals:
Enabled: false

# Allow def self.foo; @foo; end
Style/TrivialAccessors:
Enabled: false

# Allow rom-csv
Style/FileName:
Enabled: false
6 changes: 6 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-02-09 17:10:04 +0100 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.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
bundler_args: --without yard guard benchmarks
bundler_args: --without tools
env:
- CODECLIMATE_REPO_TOKEN=886f3b795e74159719804f8e18b853f4c23a81bd814404e52ec248a0dae6d656
script: "bundle exec rake spec"
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ group :test do
gem 'virtus'
gem 'minitest'
end

group :tools do
gem 'rubocop'
end
10 changes: 2 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
require "rspec/core/rake_task"
require "rubocop/rake_task"

task default: [:spec, :rubocop]
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

RuboCop::RakeTask.new do |task|
task.options << "--display-cop-names"
end
task default: :spec
18 changes: 18 additions & 0 deletions rakelib/rubocop.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
begin
require "rubocop/rake_task"

Rake::Task[:default].enhance [:rubocop]

RuboCop::RakeTask.new do |task|
task.options << "--display-cop-names"
end

namespace :rubocop do
desc 'Generate a configuration file acting as a TODO list.'
task :auto_gen_config do
exec "bundle exec rubocop --auto-gen-config"
end
end

rescue LoadError
end
2 changes: 1 addition & 1 deletion spec/integration/adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def by_name(name)
expect(jane.email).to eql('[email protected]')
expect(jane.roles.length).to eql(2)
expect(jane.roles).to eql([
{ name: 'Member' } , { name: 'Admin' }
{ name: 'Member' }, { name: 'Admin' }
])
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/test/adapter_lint_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MemoryAdapterLintTest < MiniTest::Test

def setup
@adapter = ROM::YAML::Adapter
@uri = "yaml://#{File.expand_path("./spec/fixtures/test_db.yml")}"
@uri = "yaml://#{File.expand_path('./spec/fixtures/test_db.yml')}"
end
end

Expand Down

0 comments on commit 7abb42c

Please sign in to comment.