nucop 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14bc7f191ad6c8221ad7972a133c06769a07374e7350780f5fb69c060705b8d5
4
- data.tar.gz: f1f988c516834dd83e32413732ec0bd37d628e86f96305cd86259867fef83982
3
+ metadata.gz: fde4a27e2e094af7f2a2de1d873cea9463b75b2353bde9e05fcd4b75063c42a5
4
+ data.tar.gz: c5a4366a50cd466df74cd7f0acbfd20ff8d6176d1f8860ee2d892c063b219ab3
5
5
  SHA512:
6
- metadata.gz: 97bbda786921fe144b953367e0d5f50dc0a861f1239dd7723897fc01bc748428fc46ba41c39a7d2e46a849df036e064d19e697276cad97a350f621cc17fd83fd
7
- data.tar.gz: 249ff5a852cb65c07de634e9c2c48a00a508ffece0dc5a03425e30b4c965d323a7343a1ff0a8afe21d5d3f10116e3a90ffa6722c81f7e6913a6de4d5be31c54d
6
+ metadata.gz: 5ec9ddc75385fc1c688b466405b9fabb1ed947e7065f4c18f756a818f9b6fb2b3320f4989d175e06267753a839a7082f078c0767e57cad83482dc21fa60d1984
7
+ data.tar.gz: d0e634dc581092f4b455ef72dc3520be75e6b152670affb3fb60426bb5e30a5ddcacad74f449df0eed5f2fee821d11e1bebbbce41203c3ffd808d3a81b092366
data/bin/nucop CHANGED
@@ -5,4 +5,4 @@ $LOAD_PATH.unshift("#{__dir__}/../lib")
5
5
  require "nucop"
6
6
  require "nucop/cli"
7
7
 
8
- Nucop::CLI.start(ARGV)
8
+ Nucop::Cli.start(ARGV)
@@ -3,9 +3,9 @@ require "nucop/version"
3
3
  require "rubocop"
4
4
  require "git_diff_parser"
5
5
 
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 }
9
9
 
10
10
  module Nucop
11
11
  end
@@ -5,7 +5,7 @@ RUBOCOP_DEFAULT_CONFIG_FILE = ".rubocop.yml"
5
5
  CONFIGURATION_FILEPATH = ".nucop.yml"
6
6
 
7
7
  module Nucop
8
- class CLI < Thor
8
+ class Cli < Thor
9
9
  desc "diff_enforced", "run RuboCop on the current diff using only the enforced cops"
10
10
  method_option "commit-spec", default: "origin/master", desc: "the commit used to determine the diff."
11
11
  method_option "auto-correct", type: :boolean, default: false, desc: "runs RuboCop with auto-correct option"
@@ -250,7 +250,9 @@ module Nucop
250
250
  end
251
251
 
252
252
  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)
254
256
  end
255
257
 
256
258
  # Override Thor's options method to include Nucop's options
@@ -21,16 +21,17 @@ module Nucop
21
21
  # One test case per cop per file
22
22
  COPS.each do |cop|
23
23
  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/", ""))
34
35
  end
35
36
  end
36
37
  end
@@ -1,7 +1,7 @@
1
1
  module Nucop
2
2
  module Helpers
3
3
  module FactoryBotHelper
4
- extend self
4
+ module_function
5
5
 
6
6
  FACTORY_BOT_METHODS = [
7
7
  :build,
@@ -1,3 +1,3 @@
1
1
  module Nucop
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nucop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Schweier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.79.0
61
+ version: 0.83.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.79.0
68
+ version: 0.83.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-performance
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 2.4.1
89
+ version: 2.5.2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 2.4.1
96
+ version: 2.5.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.37.0
103
+ version: 1.39.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.37.0
110
+ version: 1.39.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: ruby-progressbar
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []
174
- rubygems_version: 3.0.3
174
+ rubygems_version: 3.1.3
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Nulogy's implementation of RuboCop, including custom cops and additional