Merge pull request #82 from tbetbetbe/grpc_ruby_add_rubocop_fix_lint_style_issues
Grpc ruby add rubocop fix lint style issuespull/89/head
commit
861c79b08a
41 changed files with 2079 additions and 2219 deletions
@ -0,0 +1,10 @@ |
||||
# This is the configuration used to check the rubocop source code. |
||||
|
||||
inherit_from: .rubocop_todo.yml |
||||
|
||||
AllCops: |
||||
Exclude: |
||||
- 'bin/apis/**/*' |
||||
- 'bin/interop/test/**/*' |
||||
- 'bin/math.rb' |
||||
- 'bin/math_services.rb' |
@ -0,0 +1,52 @@ |
||||
# This configuration was generated by `rubocop --auto-gen-config` |
||||
# on 2015-01-16 02:30:04 -0800 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: 3 |
||||
# Lint/UselessAssignment: |
||||
# Enabled: false |
||||
|
||||
# Offense count: 33 |
||||
Metrics/AbcSize: |
||||
Max: 39 |
||||
|
||||
# Offense count: 3 |
||||
# Configuration parameters: CountComments. |
||||
Metrics/ClassLength: |
||||
Max: 231 |
||||
|
||||
# Offense count: 2 |
||||
Metrics/CyclomaticComplexity: |
||||
Max: 8 |
||||
|
||||
# Offense count: 36 |
||||
# Configuration parameters: CountComments. |
||||
Metrics/MethodLength: |
||||
Max: 37 |
||||
|
||||
# Offense count: 8 |
||||
# Configuration parameters: CountKeywordArgs. |
||||
Metrics/ParameterLists: |
||||
Max: 8 |
||||
|
||||
# Offense count: 2 |
||||
Metrics/PerceivedComplexity: |
||||
Max: 10 |
||||
|
||||
# Offense count: 7 |
||||
# Configuration parameters: AllowedVariables. |
||||
Style/GlobalVars: |
||||
Enabled: false |
||||
|
||||
# Offense count: 1 |
||||
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. |
||||
Style/Next: |
||||
Enabled: false |
||||
|
||||
# Offense count: 2 |
||||
# Configuration parameters: Methods. |
||||
Style/SingleLineBlockParams: |
||||
Enabled: false |
@ -1,46 +1,44 @@ |
||||
# -*- ruby -*- |
||||
require 'rake/extensiontask' |
||||
require 'rspec/core/rake_task' |
||||
require 'rubocop/rake_task' |
||||
|
||||
desc 'Run Rubocop to check for style violations' |
||||
RuboCop::RakeTask.new |
||||
|
||||
Rake::ExtensionTask.new 'grpc' do |ext| |
||||
ext.lib_dir = File.join('lib', 'grpc') |
||||
end |
||||
|
||||
SPEC_SUITES = [ |
||||
{ :id => :wrapper, :title => 'wrapper layer', :files => %w(spec/*.rb) }, |
||||
{ :id => :idiomatic, :title => 'idiomatic layer', :dir => %w(spec/generic), |
||||
:tag => '~bidi' }, |
||||
{ :id => :bidi, :title => 'bidi tests', :dir => %w(spec/generic), |
||||
:tag => 'bidi' } |
||||
{ id: :wrapper, title: 'wrapper layer', files: %w(spec/*.rb) }, |
||||
{ id: :idiomatic, title: 'idiomatic layer', dir: %w(spec/generic), |
||||
tag: '~bidi' }, |
||||
{ id: :bidi, title: 'bidi tests', dir: %w(spec/generic), |
||||
tag: 'bidi' } |
||||
] |
||||
|
||||
desc "Run all RSpec tests" |
||||
desc 'Run all RSpec tests' |
||||
namespace :spec do |
||||
namespace :suite do |
||||
SPEC_SUITES.each do |suite| |
||||
desc "Run all specs in #{suite[:title]} spec suite" |
||||
RSpec::Core::RakeTask.new(suite[:id]) do |t| |
||||
spec_files = [] |
||||
if suite[:files] |
||||
suite[:files].each { |f| spec_files += Dir[f] } |
||||
end |
||||
suite[:files].each { |f| spec_files += Dir[f] } if suite[:files] |
||||
|
||||
if suite[:dirs] |
||||
suite[:dirs].each { |f| spec_files += Dir["#{f}/**/*_spec.rb"] } |
||||
end |
||||
|
||||
t.pattern = spec_files |
||||
|
||||
if suite[:tag] |
||||
t.rspec_opts = "--tag #{suite[:tag]}" |
||||
end |
||||
t.rspec_opts = "--tag #{suite[:tag]}" if suite[:tag] |
||||
end |
||||
end |
||||
end |
||||
end |
||||
|
||||
task :default => "spec:suite:idiomatic" # this should be spec:suite:bidi |
||||
task "spec:suite:wrapper" => :compile |
||||
task "spec:suite:idiomatic" => "spec:suite:wrapper" |
||||
task "spec:suite:bidi" => "spec:suite:idiomatic" |
||||
task default: 'spec:suite:idiomatic' # this should be spec:suite:bidi |
||||
task 'spec:suite:wrapper' => :compile |
||||
task 'spec:suite:idiomatic' => 'spec:suite:wrapper' |
||||
task 'spec:suite:bidi' => 'spec:suite:idiomatic' |
||||
|
@ -1,31 +1,34 @@ |
||||
# encoding: utf-8 |
||||
$:.push File.expand_path("../lib", __FILE__) |
||||
$LOAD_PATH.push File.expand_path('../lib', __FILE__) |
||||
require 'grpc/version' |
||||
|
||||
Gem::Specification.new do |s| |
||||
s.name = "grpc" |
||||
s.name = 'grpc' |
||||
s.version = Google::RPC::VERSION |
||||
s.authors = ["One Platform Team"] |
||||
s.email = "stubby-team@google.com" |
||||
s.homepage = "http://go/grpc" |
||||
s.authors = ['One Platform Team'] |
||||
s.email = 'stubby-team@google.com' |
||||
s.homepage = 'http://go/grpc' |
||||
s.summary = 'Google RPC system in Ruby' |
||||
s.description = 'Send RPCs from Ruby' |
||||
|
||||
s.files = `git ls-files`.split("\n") |
||||
s.test_files = `git ls-files -- spec/*`.split("\n") |
||||
s.executables = `git ls-files -- examples/*.rb`.split("\n").map{ |f| File.basename(f) } |
||||
s.executables = `git ls-files -- bin/*.rb`.split("\n").map do |f| |
||||
File.basename(f) |
||||
end |
||||
s.require_paths = ['lib'] |
||||
s.platform = Gem::Platform::RUBY |
||||
|
||||
s.add_dependency 'xray' |
||||
s.add_dependency 'logging', '~> 1.8' |
||||
s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1' |
||||
s.add_dependency 'minitest', '~> 5.4' # not a dev dependency, used by the interop tests |
||||
s.add_dependency 'google-protobuf', '~> 3.0.0alpha' |
||||
s.add_dependency 'minitest', '~> 5.4' # reqd for interop tests |
||||
|
||||
s.add_development_dependency "bundler", "~> 1.7" |
||||
s.add_development_dependency "rake", "~> 10.0" |
||||
s.add_development_dependency 'bundler', '~> 1.7' |
||||
s.add_development_dependency 'rake', '~> 10.0' |
||||
s.add_development_dependency 'rake-compiler', '~> 0' |
||||
s.add_development_dependency 'rspec', "~> 3.0" |
||||
s.add_development_dependency 'rubocop', '~> 0.28.0' |
||||
s.add_development_dependency 'rspec', '~> 3.0' |
||||
|
||||
s.extensions = %w[ext/grpc/extconf.rb] |
||||
s.extensions = %w(ext/grpc/extconf.rb) |
||||
end |
||||
|
Loading…
Reference in new issue