Skip to content

Commit

Permalink
[CHANGE] Update parser, rainbow, rubocop (#264)
Browse files Browse the repository at this point in the history
* Bump parser, rainbow, rubocop

* Update CHANGELOG

* Rubocop Fixes
  • Loading branch information
joshRpowell authored and nunosilva800 committed Mar 22, 2018
1 parent 1c242dd commit b282751
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 24 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# master [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v3.3.0...master)

* [CHANGE] Update `rubocop` to 0.51.0 (by [@olleolleolle][])
* [CHANGE] Update `rubocop` to 0.51.0 (by [@olleolleolle][])
* [CHANGE] Update `parser` to 2.5.0 (by [@joshrpowell][])
* [CHANGE] Update `rainbow` to 3.0 (by [@joshrpowell][])
* [CHANGE] Update `rubocop` to 0.53.0 (by [@joshrpowell][])

# 3.3.0 / 2017-10-10 [(commits)](https://github.com/whitesmith/rubycritic/compare/v3.2.3...v3.3.0)

* [FEATURE] Add lint format similar to Golint (by [@nightscape][])
* [CHANGE] Update `cucumber` to 3.0 (by [@onumis][])
* [CHANGE] Update `cucumber` to 3.0 (by [@onumis][])
* [CHANGE] Update `rake` to 12.0 (by [@onumis][])
* [CHANGE] Update `rubocop` to 0.50.0 (by [@onumis][])
* [CHANGE] Accepting floating point values from Flog (by [@onumis][])
Expand Down Expand Up @@ -226,3 +229,4 @@
[@yuku-t]: https://github.com/yuku-t
[@ochagata]: https://github.com/ochagata
[@nightscape]: https://github.com/nightscape
[@joshrpowell]: https://github.com/joshrpowell
2 changes: 1 addition & 1 deletion bin/rubycritic
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Always look in the lib directory of this gem
# first when searching the load path
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)

require 'rubycritic/cli/application'

Expand Down
4 changes: 1 addition & 3 deletions lib/rubycritic/analysers/smells/flog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def add_smells_to(analysed_module)
@flog.flog(analysed_module.path)
@flog.each_by_score do |class_method, original_score|
score = original_score.round
if score >= HIGH_COMPLEXITY_SCORE_THRESHOLD
analysed_module.smells << create_smell(class_method, score)
end
analysed_module.smells << create_smell(class_method, score) if score >= HIGH_COMPLEXITY_SCORE_THRESHOLD
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/rubycritic/cli/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def to_h
no_browser: no_browser
}
end
# rubocop:enable Metrics/MethodLength

private

Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/core/analysed_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def to_h
}
end

def to_json(*a)
to_h.to_json(*a)
def to_json(*options)
to_h.to_json(*options)
end
end
end
4 changes: 2 additions & 2 deletions lib/rubycritic/core/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def to_h
}
end

def to_json(*a)
to_h.to_json(*a)
def to_json(*options)
to_h.to_json(*options)
end

def ==(other)
Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/core/rating.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def to_h
@letter
end

def to_json(*a)
to_h.to_json(*a)
def to_json(*options)
to_h.to_json(*options)
end
end
end
4 changes: 2 additions & 2 deletions lib/rubycritic/core/smell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def to_h
}
end

def to_json(*a)
to_h.to_json(*a)
def to_json(*options)
to_h.to_json(*options)
end

def doc_url
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/html/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def self.erb_template(template_path)
ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
end

TEMPLATES_DIR = File.expand_path('../templates', __FILE__)
TEMPLATES_DIR = File.expand_path('templates', __dir__)
LAYOUT_TEMPLATE = erb_template(File.join('layouts', 'application.html.erb'))

include ViewHelpers
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/html_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
module RubyCritic
module Generator
class HtmlReport
ASSETS_DIR = File.expand_path('../html/assets', __FILE__)
ASSETS_DIR = File.expand_path('html/assets', __dir__)

def initialize(analysed_modules)
@analysed_modules = analysed_modules
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/text/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Generator
module Text
class Lint
class << self
TEMPLATE_PATH = File.expand_path('../templates/lint.erb', __FILE__)
TEMPLATE_PATH = File.expand_path('templates/lint.erb', __dir__)
FILE_NAME = 'lint.txt'.freeze

def file_directory
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/text/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Generator
module Text
class List
class << self
TEMPLATE_PATH = File.expand_path('../templates/list.erb', __FILE__)
TEMPLATE_PATH = File.expand_path('templates/list.erb', __dir__)

def erb_template
@erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-')
Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/source_control_systems/double.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
module RubyCritic
module SourceControlSystem
class Double < Base
def revisions_count(_)
def revisions_count(_path)
0
end

def date_of_last_commit(_)
def date_of_last_commit(_path)
nil
end

Expand Down
8 changes: 4 additions & 4 deletions rubycritic.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rubycritic/version'

Expand All @@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'flay', '~> 2.8'
spec.add_runtime_dependency 'flog', '~> 4.4'
spec.add_runtime_dependency 'launchy', '2.4.3'
spec.add_runtime_dependency 'parser', '~> 2.4.0'
spec.add_runtime_dependency 'rainbow', '~> 2.1'
spec.add_runtime_dependency 'parser', '~> 2.5.0'
spec.add_runtime_dependency 'rainbow', '~> 3.0'
spec.add_runtime_dependency 'reek', '~> 4.4'
spec.add_runtime_dependency 'ruby_parser', '~> 3.8'
spec.add_runtime_dependency 'tty-which', '~> 0.3.0'
Expand All @@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest-around', '~> 0.4.0'
spec.add_development_dependency 'mocha', '~> 1.1', '>= 1.1.0'
spec.add_development_dependency 'rake', '~> 12.0', '>= 11.0.0'
spec.add_development_dependency 'rubocop', '~> 0.51', '< 0.52.0'
spec.add_development_dependency 'rubocop', '~> 0.53'
end

0 comments on commit b282751

Please sign in to comment.