code_quality 0.2.0 → 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: c173a4ac55a8c71df46b9adb9ba5f7e9618749fc716d66307a753eadc84e970f
4
- data.tar.gz: 3da24dbd87a11a7cc44dd44d0f1290bdf54d24b1ea89630269647abe3db5b891
3
+ metadata.gz: eace4c0b5c37da862ea1badeb54ef4f0163236d4f3b73134cbe7dfea9830de86
4
+ data.tar.gz: 2927bcc4f3ddff5ff6c142bfdb5835f2fafba593148c547d6e8ca6142d111df4
5
5
  SHA512:
6
- metadata.gz: 2af8be37724eab2eb916d286d431f390e8d95a98c4d5fdd6e9da7e18424f70bba97226b5e1dccca0c75d83a6b2f2327b1c9f7f5849bef9fe8ee58e7a75fc6e08
7
- data.tar.gz: 46bd00a6f06da779691f67e305c623f7fc7ff0a13fc4aeae258de03607371e7714579a5ce2664bc1ad955e0b3173c06385d3535d219002d01aa1f4042f29f178
6
+ metadata.gz: ce5e2c0afa00141987f63bbfaedfbffd7595fe1b888f9dfa90816e1de0a3b8ffd83097ddec857656ce79452417174a37b06e723e0e0891f82dccc3beba52a927
7
+ data.tar.gz: 8d318b6278cf2111400c19c0dc296c572fe6a2a3855bc22850b40bc352d2ff060330e7b8086d1562f9122c201ca1a4057d484eaff321bee1b413100f2c19d622
data/README.md CHANGED
@@ -182,11 +182,11 @@ output example:
182
182
  ##### options for rubocop
183
183
 
184
184
  ```
185
- # e.g.: code_quality quality_audit:rubocop max_offenses=100
185
+ # e.g.: code_quality quality_audit:rubocop rubocop_max_offenses=100
186
186
  # options:
187
187
  # config_formula: use which formula for config, supports "github, "rails" or path_to_your_local_config.yml, default is "github"
188
188
  # cli_options: pass extract options, e.g.: cli_options="--show-cops"
189
- # max_offenses: if config max_offenses then audit it with detected offenses number in report, e.g.: max_offenses=100
189
+ # rubocop_max_offenses: if config rubocop_max_offenses then audit it with detected offenses number in report, e.g.: rubocop_max_offenses=100
190
190
  ```
191
191
 
192
192
  output example:
@@ -215,7 +215,7 @@ output example:
215
215
 
216
216
  ```
217
217
  # run all at once
218
- code_quality quality_audit lowest_score=90 max_offenses=100 metrics=stats,rails_best_practices,roodi rails_best_practices_max_offenses=10 roodi_max_offenses=10
218
+ code_quality quality_audit lowest_score=90 rubocop_max_offenses=100 metrics=stats,rails_best_practices,roodi rails_best_practices_max_offenses=10 roodi_max_offenses=10
219
219
  ```
220
220
 
221
221
  #### work with CI
@@ -172,11 +172,11 @@ output example:
172
172
  ##### options for rubocop
173
173
 
174
174
  ```
175
- # e.g.: rake code_quality:quality_audit:rubocop max_offenses=100
175
+ # e.g.: rake code_quality:quality_audit:rubocop rubocop_max_offenses=100
176
176
  # options:
177
177
  # config_formula: use which formula for config, supports "github, "rails" or path_to_your_local_config.yml, default is "github"
178
178
  # cli_options: pass extract options, e.g.: cli_options="--show-cops"
179
- # max_offenses: if config max_offenses then audit it with detected offenses number in report, e.g.: max_offenses=100
179
+ # rubocop_max_offenses: if config rubocop_max_offenses then audit it with detected offenses number in report, e.g.: rubocop_max_offenses=100
180
180
  ```
181
181
 
182
182
  output example:
@@ -205,7 +205,7 @@ output example:
205
205
 
206
206
  ```
207
207
  # run all at once
208
- rake code_quality:quality_audit lowest_score=90 max_offenses=100 metrics=stats,rails_best_practices,roodi rails_best_practices_max_offenses=10 roodi_max_offenses=10
208
+ rake code_quality:quality_audit lowest_score=90 rubocop_max_offenses=100 metrics=stats,rails_best_practices,roodi rails_best_practices_max_offenses=10 roodi_max_offenses=10
209
209
  ```
210
210
 
211
211
  #### work with CI
@@ -1,3 +1,3 @@
1
1
  module CodeQuality
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -145,14 +145,14 @@ namespace :code_quality do
145
145
  end
146
146
 
147
147
  desc "rubocop - audit coding style"
148
- # e.g.: rake code_quality:quality_audit:rubocop max_offenses=100
148
+ # e.g.: rake code_quality:quality_audit:rubocop rubocop_max_offenses=100
149
149
  # options:
150
150
  # config_formula: use which formula for config, supports "github, "rails" or path_to_your_local_config.yml, default is "github"
151
151
  # cli_options: pass extract options, e.g.: cli_options="--show-cops"
152
- # max_offenses: if config max_offenses then audit it with detected offenses number in report, e.g.: max_offenses=100
152
+ # rubocop_max_offenses: if config rubocop_max_offenses then audit it with detected offenses number in report, e.g.: rubocop_max_offenses=100
153
153
  task :rubocop => :prepare do |task|
154
154
  run_audit task, "rubocop - RuboCop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide." do
155
- options = options_from_env(:config_formula, :cli_options, :max_offenses)
155
+ options = options_from_env(:config_formula, :cli_options, :rubocop_max_offenses)
156
156
 
157
157
  config_formulas = {
158
158
  'github' => 'https://github.com/github/rubocop-github',
@@ -177,12 +177,12 @@ namespace :code_quality do
177
177
  puts "Report generated to #{report_path}"
178
178
  show_in_browser File.realpath(report_path)
179
179
 
180
- # if config max_offenses then audit it with detected offenses number in report
181
- if options[:max_offenses]
180
+ # if config rubocop_max_offenses then audit it with detected offenses number in report
181
+ if options[:rubocop_max_offenses]
182
182
  if report[-20..-1] =~ /(\d+) *Total/
183
183
  detected_offenses = $1.to_i
184
- max_offenses = options[:max_offenses].to_i
185
- audit_faild "Detected offenses #{colorize(detected_offenses, :yellow)} is more then #{colorize(max_offenses, :yellow)}, must improve your code quality or set a lower #{colorize("max_offenses", :black, :white)}" if detected_offenses > max_offenses
184
+ max_offenses = options[:rubocop_max_offenses].to_i
185
+ audit_faild "Detected offenses #{colorize(detected_offenses, :yellow)} is more then #{colorize(max_offenses, :yellow)}, must improve your code quality or set a lower #{colorize("rubocop_max_offenses", :black, :white)}" if detected_offenses > max_offenses
186
186
  end
187
187
  end
188
188
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RainChen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-01 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler-audit
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  requirements: []
189
189
  rubyforge_project:
190
- rubygems_version: 2.7.4
190
+ rubygems_version: 2.7.6
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: run code quality and security audit report with one command