Skip to content

Commit

Permalink
Latest versions of the various Rubocop gems
Browse files Browse the repository at this point in the history
- Bump the gem version
- Update the CHANGELOG
  • Loading branch information
amckinnell committed May 14, 2020
1 parent 1ceb1c7 commit 3246585
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 32 deletions.
51 changes: 51 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Layout/EmptyLineAfterGuardClause:
Enabled: false

Layout/LineLength:
Enabled: false

Layout/MultilineMethodCallIndentation:
Enabled: false

Metrics/AbcSize:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

Style/Documentation:
Enabled: false

Style/ExpandPathArguments:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/Lambda:
Enabled: false

Style/IfUnlessModifier:
Enabled: false

Style/MutableConstant:
Enabled: false

Style/RegexpLiteral:
Enabled: false

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/SymbolArray:
Enabled: false
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## master (unreleased)

## 0.3.0 (2020-05-14)

* Renamed CLI class to Cli
* Latest versions of the various Rubocop gems

## 0.2.1 (2020-03-21)

Expand Down
41 changes: 28 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
PATH
remote: .
specs:
nucop (0.2.0)
nucop (0.3.0)
git_diff_parser (= 3.2)
rubocop (= 0.79.0)
rubocop (= 0.83.0)
rubocop-performance (= 1.5.2)
rubocop-rails (= 2.4.1)
rubocop-rspec (= 1.37.0)
rubocop-rails (= 2.5.2)
rubocop-rspec (= 1.39.0)
ruby-progressbar (~> 1.10)

GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
ast (2.4.0)
concurrent-ruby (1.1.6)
diff-lcs (1.3)
git_diff_parser (3.2.0)
jaro_winkler (1.5.4)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
minitest (5.14.0)
parallel (1.19.1)
parser (2.7.0.2)
parser (2.7.1.2)
ast (~> 2.4.0)
rack (2.1.1)
rack (2.2.2)
rainbow (3.0.0)
rake (13.0.0)
rexml (3.2.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
Expand All @@ -35,22 +45,27 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
rubocop (0.83.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.1)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
rubocop-rspec (1.39.0)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
unicode-display_width (1.6.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
zeitwerk (2.3.0)

PLATFORMS
ruby
Expand Down
6 changes: 3 additions & 3 deletions lib/nucop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require "rubocop"
require "git_diff_parser"

Dir[File.join(__dir__, "nucop/helpers/**/*.rb")].each { |f| require f }
Dir[File.join(__dir__, "nucop/formatters/**/*.rb")].each { |f| require f }
Dir[File.join(__dir__, "nucop/cops/**/*.rb")].each { |f| require f }
Dir[File.join(__dir__, "nucop/helpers/**/*.rb")].sort.each { |f| require f }
Dir[File.join(__dir__, "nucop/formatters/**/*.rb")].sort.each { |f| require f }
Dir[File.join(__dir__, "nucop/cops/**/*.rb")].sort.each { |f| require f }

module Nucop
end
4 changes: 3 additions & 1 deletion lib/nucop/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def cops_without_violations
end

def enabled_cops
YAML.load(`bundle exec rubocop --parallel --show-cops`).select { |_, config| config["Enabled"] }.map(&:first)
YAML.load(`bundle exec rubocop --parallel --show-cops`) # rubocop:disable Security/YAMLLoad
.select { |_, config| config["Enabled"] }
.map(&:first)
end

# Override Thor's options method to include Nucop's options
Expand Down
21 changes: 11 additions & 10 deletions lib/nucop/formatters/junit_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ def file_finished(file, offences)
# One test case per cop per file
COPS.each do |cop|
cop_offences = offences.select { |offence| offence.cop_name == cop.cop_name }
unless cop_offences.empty?
REXML::Element.new("testcase", @testsuite).tap do |f|
f.attributes["classname"] = file.gsub(/\.rb\Z/, "").gsub("#{Dir.pwd}/", "").tr("/", ".")
f.attributes["name"] = "Rubocop: #{cop.cop_name}"
f.attributes["file"] = cop.cop_name
cop_offences.each do |offence|
REXML::Element.new("failure", f).tap do |e|
e.add_text("#{offence.message}\n\n")
e.add_text(offence.location.to_s.sub("/usr/src/app/", ""))
end

next if cop_offences.empty?

REXML::Element.new("testcase", @testsuite).tap do |f|
f.attributes["classname"] = file.gsub(/\.rb\Z/, "").gsub("#{Dir.pwd}/", "").tr("/", ".")
f.attributes["name"] = "Rubocop: #{cop.cop_name}"
f.attributes["file"] = cop.cop_name
cop_offences.each do |offence|
REXML::Element.new("failure", f).tap do |e|
e.add_text("#{offence.message}\n\n")
e.add_text(offence.location.to_s.sub("/usr/src/app/", ""))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/nucop/helpers/factory_bot_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Nucop
module Helpers
module FactoryBotHelper
extend self
module_function

FACTORY_BOT_METHODS = [
:build,
Expand Down
2 changes: 1 addition & 1 deletion lib/nucop/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Nucop
VERSION = "0.2.1"
VERSION = "0.3.0"
end
6 changes: 3 additions & 3 deletions nucop.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "3.9.0"

spec.add_dependency "git_diff_parser", "3.2"
spec.add_dependency "rubocop", "0.79.0"
spec.add_dependency "rubocop", "0.83.0"
spec.add_dependency "rubocop-performance", "1.5.2"
spec.add_dependency "rubocop-rails", "2.4.1"
spec.add_dependency "rubocop-rspec", "1.37.0"
spec.add_dependency "rubocop-rails", "2.5.2"
spec.add_dependency "rubocop-rspec", "1.39.0"
spec.add_dependency "ruby-progressbar", "~> 1.10"
end

0 comments on commit 3246585

Please sign in to comment.