Skip to content

Commit

Permalink
Update to 0.10.3, add rubocop+bundler-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
splittingred committed Jul 12, 2017
1 parent c2a1f64 commit 0cbd9cb
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,13 @@
inherit_from:
- .rubocop_todo.yml

AllCops:
Exclude:
- spec/**/*
- .bundle/**/*
- bin/**/*
- vendor/**/*
- tmp/**/*
- log/**/*
- Rakefile
- gruf-zipkin.gemspec
127 changes: 127 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,127 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 25`
# on 2016-05-04 17:58:49 +0000 using RuboCop version 0.39.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.

# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
# SupportedStyles: keyword, variable, start_of_line
Lint/EndAlignment:
Enabled: false

Lint/AmbiguousOperator:
Enabled: false

Metrics/AbcSize:
Max: 147

Metrics/BlockNesting:
Max: 4

# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 406

Metrics/CyclomaticComplexity:
Max: 24

# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Enabled: false

# Offense count: 63
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 88

# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 1000

# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 9

Metrics/PerceivedComplexity:
Max: 26

Performance/RedundantBlockCall:
Enabled: false

# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth.
# SupportedStyles: case, end
Layout/CaseIndentation:
Enabled: false

Layout/EmptyLineAfterMagicComment:
Enabled: false

Style/ColonMethodCall:
Exclude:
- 'db/seeds.rb'

Style/Documentation:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundClassBody:
Enabled: false

# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'config.ru'
- 'config/routes.rb'
- 'bin/rails'

# Because $stats is valid
Style/GlobalVars:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentHash:
Enabled: false

Layout/LeadingCommentSpace:
Exclude:
- 'Capfile'

# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: snake_case, camelCase
Style/MethodName:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineMethodCallIndentation:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Enabled: false

# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Enabled: false

Style/PercentLiteralDelimiters:
Enabled: false
13 changes: 13 additions & 0 deletions .travis.sh
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

if [ "$TEST_GROUP" == "prereq" ]
then
bundle exec bundle-audit update
bundle exec bundle-audit check -v
bundle exec rubocop

elif [ "$TEST_GROUP" == "1" ]
then
bundle exec rspec
fi
13 changes: 11 additions & 2 deletions .travis.yml
@@ -1,8 +1,17 @@
language: ruby
cache:
bundler: true
sudo: false
dist: trusty
rvm:
- 2.2.5
before_install: gem install bundler -v 1.11.2
- 2.2
- 2.3
- 2.4
before_install: gem install bundler -v 1.15.1
script: ./.travis.sh
env:
matrix:
- TEST_GROUP=prereq
- TEST_GROUP=1
matrix:
fast_finish: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog for the gruf-zipkin gem.

h3. 0.10.3

- Update to 0.10.3, add rubocop+bundler-audit

h3. 0.10.2

- Updated license to MIT
Expand Down
8 changes: 7 additions & 1 deletion Gemfile
Expand Up @@ -16,6 +16,12 @@
#
source 'https://rubygems.org'

gem 'gruf', git: 'git@github.com:bigcommerce/gruf', tag: 'v0.14.1'
gem 'gruf', '1.1.0'

group :development do
gem 'bundler-audit'
gem 'rubocop', '~> 0.49.1'
gem 'simplecov', require: false
end

gemspec
1 change: 0 additions & 1 deletion lib/gruf/zipkin.rb
Expand Up @@ -23,6 +23,5 @@

module Gruf
module Zipkin

end
end
2 changes: 1 addition & 1 deletion lib/gruf/zipkin/hook.rb
Expand Up @@ -51,7 +51,7 @@ def around(call_signature, request, active_call, &block)
# @return [String]
#
def service_key
service.class.name.underscore.gsub('/','.')
service.class.name.underscore.tr('/', '.')
end

##
Expand Down
5 changes: 2 additions & 3 deletions lib/gruf/zipkin/trace.rb
Expand Up @@ -30,7 +30,7 @@ class Trace
error: 'grpc.error',
error_code: 'grpc.error_code',
error_class: 'grpc.error_class',
success: 'grpc.success',
success: 'grpc.success'
}
}.freeze

Expand Down Expand Up @@ -86,11 +86,10 @@ def trace!(tracer, &block)
result
end


##
# Memoize build of a new trace_id based on propagation headers, or generator if
# no headers are present
#
#
# @return [::Trace::TraceId]
#
def trace_id
Expand Down
2 changes: 1 addition & 1 deletion lib/gruf/zipkin/version.rb
Expand Up @@ -16,6 +16,6 @@
#
module Gruf
module Zipkin
VERSION = '0.10.2'.freeze
VERSION = '0.10.3'.freeze
end
end
32 changes: 32 additions & 0 deletions spec/simplecov_helper.rb
@@ -0,0 +1,32 @@
# coding: utf-8
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
require 'simplecov'
require 'fileutils'

if File.directory?('./coverage/')
coverage_path = File.realpath('./coverage/')
FileUtils.rm_rf(coverage_path)
end

SimpleCov.command_name 'Unit Tests'
SimpleCov.minimum_coverage 75
SimpleCov.start do
add_filter '/bin/'
add_filter '/coverage/'
add_filter '/spec/'
add_filter '/vendor/'
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Expand Up @@ -15,6 +15,7 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require_relative 'simplecov_helper'
require 'pry'
require 'gruf'
require 'gruf/zipkin'
Expand Down

0 comments on commit 0cbd9cb

Please sign in to comment.