nucop 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96431415f4ba9ffdeccc8b3f831946afb8d32326b680b4c015061ad66038a89a
4
- data.tar.gz: 713830bb560b1dd38cf70409e57f0a8af2616f9cac5e6c52c5429db89dbd6242
3
+ metadata.gz: 14bc7f191ad6c8221ad7972a133c06769a07374e7350780f5fb69c060705b8d5
4
+ data.tar.gz: f1f988c516834dd83e32413732ec0bd37d628e86f96305cd86259867fef83982
5
5
  SHA512:
6
- metadata.gz: 903b54b802f7d86f1476eb675785dfa251ae03a6b731d7e1069ca45df405d2ec3a4a84cdfb4e8411bfc3ef22e1a16f93c81c77f65031091b16255b21c7d21823
7
- data.tar.gz: 95ef89faf62bb7528b88362d44e408ed793829f7993c1a6885e184e43c591e26d364a6a7a0119216fc2910dc3ca9f8b185acb76d27d46793a7391083cc0b866f
6
+ metadata.gz: 97bbda786921fe144b953367e0d5f50dc0a861f1239dd7723897fc01bc748428fc46ba41c39a7d2e46a849df036e064d19e697276cad97a350f621cc17fd83fd
7
+ data.tar.gz: 249ff5a852cb65c07de634e9c2c48a00a508ffece0dc5a03425e30b4c965d323a7343a1ff0a8afe21d5d3f10116e3a90ffa6722c81f7e6913a6de4d5be31c54d
@@ -9,7 +9,8 @@ module Nucop
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"
12
- method_option "junit_report", type: :string, default: "", desc: "runs RuboCop with junit formatter option"
12
+ method_option "junit_report", type: :string, default: nil, desc: "runs RuboCop with junit formatter option"
13
+ method_option "json", type: :string, default: nil, desc: "Output results as JSON format to the provided file"
13
14
  def diff_enforced
14
15
  invoke :diff, nil, options.merge(only: cops_to_enforce.join(","))
15
16
  end
@@ -66,16 +67,30 @@ module Nucop
66
67
  def rubocop(files = nil)
67
68
  print_cops_being_run(options[:only])
68
69
  config_file = options[:"exclude-backlog"] ? RUBOCOP_DEFAULT_CONFIG_FILE : options[:rubocop_todo_config_file]
69
- junit_report_path = options[:"junit_report"]
70
- junit_report_options = junit_report_path.to_s.empty? ? "" : "--format Nucop::Formatters::JUnitFormatter --out #{junit_report_path} --format progress"
71
-
72
70
  rubocop_requires = [
73
71
  "--require rubocop-rspec",
74
72
  "--require rubocop-performance",
75
73
  "--require rubocop-rails"
76
74
  ]
77
75
 
78
- system("bundle exec rubocop --parallel #{rubocop_requires.join(' ')} #{junit_report_options} --force-exclusion --config #{config_file} #{pass_through_option(options, 'auto-correct')} #{pass_through_flag(options, 'only')} #{files}")
76
+ formatters = []
77
+ formatters << "--format Nucop::Formatters::JUnitFormatter --out #{options[:junit_report]}" if options[:junit_report]
78
+ formatters << "--format json --out #{options[:json]}" if options[:json]
79
+ formatters << "--format progress" if formatters.any?
80
+
81
+ command = [
82
+ "bundle exec rubocop",
83
+ "--parallel",
84
+ rubocop_requires.join(" "),
85
+ formatters.join(" "),
86
+ "--force-exclusion",
87
+ "--config", config_file,
88
+ pass_through_option(options, "auto-correct"),
89
+ pass_through_flag(options, "only"),
90
+ files
91
+ ].join(" ")
92
+
93
+ system(command)
79
94
  end
80
95
 
81
96
  desc "regen_backlog", "update the RuboCop backlog, disabling offending files and excluding all cops with over 500 violating files."
@@ -1,3 +1,3 @@
1
1
  module Nucop
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.0
4
+ version: 0.2.1
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-01-19 00:00:00.000000000 Z
11
+ date: 2020-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -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.1.2
174
+ rubygems_version: 3.0.3
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Nulogy's implementation of RuboCop, including custom cops and additional