Skip to content

Commit

Permalink
Merge pull request #12 from chamberflag/feature/rubocop
Browse files Browse the repository at this point in the history
Add RuboCop to CI and fix most lints
  • Loading branch information
joelbarker2011 authored Oct 13, 2018
2 parents 87f84e1 + 1abba9a commit 11e1c80
Show file tree
Hide file tree
Showing 48 changed files with 997 additions and 676 deletions.
14 changes: 14 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
inherit_from: .rubocop_todo.yml

AllCops:
DisplayStyleGuide: true
ExtraDetails: true

Metrics/LineLength:
Max: 120

Style/StringLiterals:
Enabled: false

Style/SymbolArray:
EnforcedStyle: brackets
241 changes: 241 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-10-12 12:08:53 -0700 using RuboCop version 0.59.2.
# 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: 5
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/echosign/request.rb'

# Offense count: 2
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'spec/lib/client_spec.rb'

# Offense count: 3
Lint/RescueException:
Exclude:
- 'lib/echosign/request.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/echosign/widget/widget_completion_info.rb'

# Offense count: 1
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'lib/echosign/request.rb'

# Offense count: 17
Lint/UselessAssignment:
Exclude:
- 'lib/echosign/agreement/client.rb'
- 'lib/echosign/agreement/request.rb'
- 'lib/echosign/client.rb'
- 'lib/echosign/library_documents/request.rb'
- 'lib/echosign/mega_sign/client.rb'
- 'lib/echosign/mega_sign/request.rb'
- 'lib/echosign/request.rb'
- 'lib/echosign/widget/request.rb'

# Offense count: 8
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 123

# Offense count: 3
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 11

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 101

# Offense count: 6
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 7

# Offense count: 2
Naming/AccessorMethodName:
Exclude:
- 'lib/echosign/agreement/client.rb'
- 'lib/echosign/mega_sign/client.rb'

# Offense count: 18
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db
Naming/UncommunicativeMethodParamName:
Exclude:
- 'lib/echosign/agreement/client.rb'
- 'lib/echosign/agreement/request.rb'
- 'lib/echosign/library_documents/client.rb'
- 'lib/echosign/library_documents/request.rb'
- 'lib/echosign/mega_sign/client.rb'
- 'lib/echosign/mega_sign/request.rb'

# Offense count: 18
# Configuration parameters: EnforcedStyle.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'lib/echosign/agreement/client.rb'
- 'lib/echosign/agreement/request.rb'
- 'lib/echosign/library_documents/client.rb'
- 'lib/echosign/library_documents/request.rb'
- 'lib/echosign/mega_sign/client.rb'
- 'lib/echosign/mega_sign/request.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
# SupportedStyles: line_count_based, semantic, braces_for_chaining
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
# FunctionalMethods: let, let!, subject, watch
# IgnoredMethods: lambda, proc, it
Style/BlockDelimiters:
Exclude:
- 'spec/lib/client_spec.rb'
- 'spec/lib/shared_client.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'lib/echosign/agreement.rb'
- 'lib/echosign/mega_sign.rb'
- 'lib/echosign/refresh.rb'
- 'lib/echosign/request.rb'
- 'lib/echosign/widget.rb'
- 'lib/echosign/widget/widget_completion_info.rb'
- 'spec/lib/agreement/client_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/echosign/agreement/request.rb'
- 'lib/echosign/library_documents/request.rb'
- 'lib/echosign/mega_sign/request.rb'
- 'lib/echosign/request.rb'
- 'lib/echosign/widget/request.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: Keywords.
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
Style/CommentAnnotation:
Exclude:
- 'lib/echosign/agreement.rb'
- 'lib/echosign/mega_sign.rb'
- 'lib/echosign/validatable.rb'

# Offense count: 9
Style/CommentedKeyword:
Exclude:
- 'lib/echosign/agreement.rb'
- 'lib/echosign/client.rb'
- 'lib/echosign/mega_sign.rb'
- 'lib/echosign/user.rb'
- 'spec/lib/client_spec.rb'

# Offense count: 35
Style/Documentation:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Style/LineEndConcatenation:
Exclude:
- 'lib/echosign/agreement.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
Style/MethodDefParentheses:
Exclude:
- 'lib/echosign/request.rb'

# Offense count: 8
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'lib/echosign/credentials.rb'
- 'lib/echosign/request.rb'
- 'lib/echosign/version.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IncludeSemanticChanges.
Style/NonNilCheck:
Exclude:
- 'lib/echosign/credentials.rb'

# Offense count: 6
Style/OptionalArguments:
Exclude:
- 'lib/echosign/agreement.rb'
- 'lib/echosign/mega_sign.rb'
- 'lib/echosign/widget.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
Exclude:
- 'lib/echosign/agreement.rb'
- 'lib/echosign/agreement/client.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/RedundantBegin:
Exclude:
- 'lib/echosign/request.rb'
- 'lib/echosign/validatable.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/echosign/credentials.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Exclude:
- 'lib/echosign/agreement.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/echosign/request.rb'
- 'lib/echosign/widget/widget_completion_info.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/echosign/widget/request.rb'
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ rvm:
- 2.5
- 2.4
- 2.3
script:
- bundle exec rubocop --fail-fast
- bundle exec rake
20 changes: 19 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
coderay (1.1.0)
concurrent-ruby (1.0.5)
crack (0.4.3)
Expand All @@ -31,6 +32,7 @@ GEM
multi_xml (>= 0.5.2)
i18n (1.1.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1)
json (2.1.0)
jwt (1.5.6)
method_source (0.8.2)
Expand All @@ -44,12 +46,17 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.10.0)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (3.0.3)
rack (2.0.5)
rainbow (3.0.0)
rake (10.3.2)
rspec (3.0.0)
rspec-core (~> 3.0.0)
Expand All @@ -63,6 +70,15 @@ GEM
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-support (3.0.3)
rubocop (0.59.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
safe_yaml (1.0.4)
simplecov (0.16.1)
docile (~> 1.1)
Expand All @@ -73,6 +89,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
vcr (4.0.0)
webmock (3.4.2)
addressable (>= 2.3.6)
Expand All @@ -90,10 +107,11 @@ DEPENDENCIES
pry (~> 0.10)
rake (~> 10)
rspec (~> 3)
rubocop (~> 0.59)
simplecov (~> 0.16)
vcr (~> 4)
webmock (~> 3)
yard (~> 0.8)

BUNDLED WITH
1.16.4
1.16.6
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'bundler/gem_tasks'
# Default directory to look in is `/specs`
# Run with `rake spec`
RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = ['--color', '--format', 'documentation', '--fail-fast']
task.rspec_opts = ['--color', '--format', 'documentation', '--fail-fast']
end

task :default => :spec
task default: :spec
20 changes: 10 additions & 10 deletions echosign.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'echosign/version'

Expand All @@ -8,8 +7,8 @@ Gem::Specification.new do |spec|
spec.version = Echosign::VERSION
spec.authors = ["Bernard Worthy"]
spec.email = ["cthomas@railjumper.com"]
spec.summary = %q{Package summary}
spec.description = %q{A ruby gem that simplifies the use of Adobe's EchoSign web API.}
spec.summary = 'Package summary'
spec.description = "A ruby gem that simplifies the use of Adobe's EchoSign web API."
spec.homepage = "http://github.com/bernardworthy/echosign"
spec.license = "MIT"

Expand All @@ -19,16 +18,17 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "factory_girl", "~> 4"
spec.add_development_dependency "pry", "~> 0.10"
spec.add_development_dependency "rake", "~> 10"
spec.add_development_dependency "rspec", "~> 3"
spec.add_development_dependency "pry", "~> 0.10"
spec.add_development_dependency "yard", "~> 0.8"
spec.add_development_dependency "webmock", "~> 3"
spec.add_development_dependency "vcr", "~> 4"
spec.add_development_dependency "factory_girl", "~> 4"
spec.add_development_dependency "rubocop", "~> 0.59"
spec.add_development_dependency "simplecov", "~> 0.16"
spec.add_development_dependency "vcr", "~> 4"
spec.add_development_dependency "webmock", "~> 3"
spec.add_development_dependency "yard", "~> 0.8"

spec.add_dependency "json", "~> 2"
spec.add_dependency "httparty", "~> 0.16"
spec.add_dependency "json", "~> 2"
spec.add_dependency "oauth2", "~> 1"
end
Loading

0 comments on commit 11e1c80

Please sign in to comment.