Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit 3246585

Browse files
committed
Latest versions of the various Rubocop gems
- Bump the gem version - Update the CHANGELOG
1 parent 1ceb1c7 commit 3246585

9 files changed

Lines changed: 104 additions & 32 deletions

File tree

.rubocop.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Layout/EmptyLineAfterGuardClause:
2+
Enabled: false
3+
4+
Layout/LineLength:
5+
Enabled: false
6+
7+
Layout/MultilineMethodCallIndentation:
8+
Enabled: false
9+
10+
Metrics/AbcSize:
11+
Enabled: false
12+
13+
Metrics/ClassLength:
14+
Enabled: false
15+
16+
Metrics/CyclomaticComplexity:
17+
Enabled: false
18+
19+
Metrics/MethodLength:
20+
Enabled: false
21+
22+
Metrics/PerceivedComplexity:
23+
Enabled: false
24+
25+
Style/Documentation:
26+
Enabled: false
27+
28+
Style/ExpandPathArguments:
29+
Enabled: false
30+
31+
Style/FrozenStringLiteralComment:
32+
Enabled: false
33+
34+
Style/Lambda:
35+
Enabled: false
36+
37+
Style/IfUnlessModifier:
38+
Enabled: false
39+
40+
Style/MutableConstant:
41+
Enabled: false
42+
43+
Style/RegexpLiteral:
44+
Enabled: false
45+
46+
Style/StringLiterals:
47+
Enabled: true
48+
EnforcedStyle: double_quotes
49+
50+
Style/SymbolArray:
51+
Enabled: false

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## master (unreleased)
44

5+
## 0.3.0 (2020-05-14)
6+
57
* Renamed CLI class to Cli
8+
* Latest versions of the various Rubocop gems
69

710
## 0.2.1 (2020-03-21)
811

Gemfile.lock

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
PATH
22
remote: .
33
specs:
4-
nucop (0.2.0)
4+
nucop (0.3.0)
55
git_diff_parser (= 3.2)
6-
rubocop (= 0.79.0)
6+
rubocop (= 0.83.0)
77
rubocop-performance (= 1.5.2)
8-
rubocop-rails (= 2.4.1)
9-
rubocop-rspec (= 1.37.0)
8+
rubocop-rails (= 2.5.2)
9+
rubocop-rspec (= 1.39.0)
1010
ruby-progressbar (~> 1.10)
1111

1212
GEM
1313
remote: https://rubygems.org/
1414
specs:
15+
activesupport (6.0.3)
16+
concurrent-ruby (~> 1.0, >= 1.0.2)
17+
i18n (>= 0.7, < 2)
18+
minitest (~> 5.1)
19+
tzinfo (~> 1.1)
20+
zeitwerk (~> 2.2, >= 2.2.2)
1521
ast (2.4.0)
22+
concurrent-ruby (1.1.6)
1623
diff-lcs (1.3)
1724
git_diff_parser (3.2.0)
18-
jaro_winkler (1.5.4)
25+
i18n (1.8.2)
26+
concurrent-ruby (~> 1.0)
27+
minitest (5.14.0)
1928
parallel (1.19.1)
20-
parser (2.7.0.2)
29+
parser (2.7.1.2)
2130
ast (~> 2.4.0)
22-
rack (2.1.1)
31+
rack (2.2.2)
2332
rainbow (3.0.0)
2433
rake (13.0.0)
34+
rexml (3.2.4)
2535
rspec (3.9.0)
2636
rspec-core (~> 3.9.0)
2737
rspec-expectations (~> 3.9.0)
@@ -35,22 +45,27 @@ GEM
3545
diff-lcs (>= 1.2.0, < 2.0)
3646
rspec-support (~> 3.9.0)
3747
rspec-support (3.9.2)
38-
rubocop (0.79.0)
39-
jaro_winkler (~> 1.5.1)
48+
rubocop (0.83.0)
4049
parallel (~> 1.10)
4150
parser (>= 2.7.0.1)
4251
rainbow (>= 2.2.2, < 4.0)
52+
rexml
4353
ruby-progressbar (~> 1.7)
44-
unicode-display_width (>= 1.4.0, < 1.7)
54+
unicode-display_width (>= 1.4.0, < 2.0)
4555
rubocop-performance (1.5.2)
4656
rubocop (>= 0.71.0)
47-
rubocop-rails (2.4.1)
57+
rubocop-rails (2.5.2)
58+
activesupport
4859
rack (>= 1.1)
4960
rubocop (>= 0.72.0)
50-
rubocop-rspec (1.37.0)
61+
rubocop-rspec (1.39.0)
5162
rubocop (>= 0.68.1)
5263
ruby-progressbar (1.10.1)
53-
unicode-display_width (1.6.1)
64+
thread_safe (0.3.6)
65+
tzinfo (1.2.7)
66+
thread_safe (~> 0.1)
67+
unicode-display_width (1.7.0)
68+
zeitwerk (2.3.0)
5469

5570
PLATFORMS
5671
ruby

lib/nucop.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
require "rubocop"
44
require "git_diff_parser"
55

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

1010
module Nucop
1111
end

lib/nucop/cli.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ def cops_without_violations
250250
end
251251

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

256258
# Override Thor's options method to include Nucop's options

lib/nucop/formatters/junit_formatter.rb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ def file_finished(file, offences)
2121
# One test case per cop per file
2222
COPS.each do |cop|
2323
cop_offences = offences.select { |offence| offence.cop_name == cop.cop_name }
24-
unless cop_offences.empty?
25-
REXML::Element.new("testcase", @testsuite).tap do |f|
26-
f.attributes["classname"] = file.gsub(/\.rb\Z/, "").gsub("#{Dir.pwd}/", "").tr("/", ".")
27-
f.attributes["name"] = "Rubocop: #{cop.cop_name}"
28-
f.attributes["file"] = cop.cop_name
29-
cop_offences.each do |offence|
30-
REXML::Element.new("failure", f).tap do |e|
31-
e.add_text("#{offence.message}\n\n")
32-
e.add_text(offence.location.to_s.sub("/usr/src/app/", ""))
33-
end
24+
25+
next if cop_offences.empty?
26+
27+
REXML::Element.new("testcase", @testsuite).tap do |f|
28+
f.attributes["classname"] = file.gsub(/\.rb\Z/, "").gsub("#{Dir.pwd}/", "").tr("/", ".")
29+
f.attributes["name"] = "Rubocop: #{cop.cop_name}"
30+
f.attributes["file"] = cop.cop_name
31+
cop_offences.each do |offence|
32+
REXML::Element.new("failure", f).tap do |e|
33+
e.add_text("#{offence.message}\n\n")
34+
e.add_text(offence.location.to_s.sub("/usr/src/app/", ""))
3435
end
3536
end
3637
end

lib/nucop/helpers/factory_bot_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Nucop
22
module Helpers
33
module FactoryBotHelper
4-
extend self
4+
module_function
55

66
FACTORY_BOT_METHODS = [
77
:build,

lib/nucop/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Nucop
2-
VERSION = "0.2.1"
2+
VERSION = "0.3.0"
33
end

nucop.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
2929
spec.add_development_dependency "rspec", "3.9.0"
3030

3131
spec.add_dependency "git_diff_parser", "3.2"
32-
spec.add_dependency "rubocop", "0.79.0"
32+
spec.add_dependency "rubocop", "0.83.0"
3333
spec.add_dependency "rubocop-performance", "1.5.2"
34-
spec.add_dependency "rubocop-rails", "2.4.1"
35-
spec.add_dependency "rubocop-rspec", "1.37.0"
34+
spec.add_dependency "rubocop-rails", "2.5.2"
35+
spec.add_dependency "rubocop-rspec", "1.39.0"
3636
spec.add_dependency "ruby-progressbar", "~> 1.10"
3737
end

0 commit comments

Comments
 (0)