Skip to content

Commit 0ae0b4c

Browse files
authored
Merge pull request solidusio#155 from solidusio/check_rubocop
Add Rubocop to the CI checks
2 parents 38ada19 + 7b23835 commit 0ae0b4c

14 files changed

Lines changed: 56 additions & 32 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ spec/dummy
1616
.rvmrc
1717
.sass-cache
1818
public/spree
19-
.ruby-version
2019
.ruby-gemset

.rubocop.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
---
22
inherit_from: .hound.yml
33

4+
Metrics/BlockLength:
5+
Exclude:
6+
- spec/**/*
7+
- lib/tasks/**/*
8+
49
AllCops:
510
Exclude:
6-
- spec/dummy/**/*
7-
- bin/*
11+
- 'spec/dummy/**/*'
12+
- 'bin/**/*'
13+
- 'vendor/**/*'

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.5.1

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ language: ruby
55
before_install:
66
- gem update --system # https://github.com/travis-ci/travis-ci/issues/8978
77
- gem install bundler
8-
rvm:
9-
- 2.5
8+
script:
9+
- bundle exec rubocop
10+
- bundle exec rake

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
source "https://rubygems.org"
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
24

35
branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4-
gem "solidus", github: "solidusio/solidus", branch: branch
6+
gem 'solidus', github: 'solidusio/solidus', branch: branch
57

68
if ENV['DB'] == 'mysql'
79
gem 'mysql2', '~> 0.4.10'
@@ -10,8 +12,8 @@ else
1012
end
1113

1214
group :development, :test do
13-
gem "pry-rails"
1415
gem 'i18n-tasks', '~> 0.9' if branch == 'master'
16+
gem 'pry-rails'
1517
end
1618

1719
gemspec

Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
# frozen_string_literal: true
2+
13
require 'bundler'
24
Bundler::GemHelper.install_tasks
35

46
require 'rspec/core/rake_task'
57
RSpec::Core::RakeTask.new
68

79
task :default do
8-
if Dir["spec/dummy"].empty?
10+
if Dir['spec/dummy'].empty?
911
Rake::Task[:test_app].invoke
10-
Dir.chdir("../../")
12+
Dir.chdir('../../')
1113
end
1214
Rake::Task[:spec].invoke
1315
end
@@ -24,12 +26,10 @@ namespace :solidus_i18n do
2426
desc 'Update by retrieving the latest Solidus locale files'
2527
task :update_default do
2628
require 'open-uri'
27-
puts "Fetching latest Solidus locale file"
29+
puts 'Fetching latest Solidus locale file'
2830
location = 'https://raw.github.com/solidusio/solidus/master/core/config/locales/en.yml'
2931

30-
open("#{locales_dir}/en.yml", 'wb') do |file|
31-
file << open(location).read
32-
end
32+
File.write("#{locales_dir}/en.yml", URI.parse(location).read)
3333
end
3434

3535
def locales_dir

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
Spree::Core::Engine.routes.draw do
24
end

lib/solidus_i18n.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'solidus_core'
24
require 'solidus_i18n/engine'
35
require 'solidus_i18n/version'

lib/solidus_i18n/engine.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SolidusI18n
24
class Engine < Rails::Engine
35
engine_name 'solidus_i18n'

lib/solidus_i18n/version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SolidusI18n
24
module_function
35

0 commit comments

Comments
 (0)