quality 23.0.7 → 24.0.0

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
  SHA1:
3
- metadata.gz: e9bc167ba873b117fd6a68918b2d725e6ed690c7
4
- data.tar.gz: b6449ddb9ef200f22ede802b4b725ef0599b1800
3
+ metadata.gz: dd65945bd7c35435a89f463fdd85f22e8230ba3e
4
+ data.tar.gz: a3c9d4c3e91eaf36dc41be20894093f1b10e8bb3
5
5
  SHA512:
6
- metadata.gz: fa41d35028970df19bd0a9ba63dd6f2bc2dd9cdeb3db366b14bee04783d8712a7ecb16854c0f2d55ff609405c3b303fbbc836e2bbd2fbe3df40e0c23766542ee
7
- data.tar.gz: 814504792158be36626ff1ffd92d1fc0119a12f56505be93cf22d599d788a6e3a67e5a21c3735dbc89d4b4afd6b3b82c459f3e95516be44336ae02a9597ab3d0
6
+ metadata.gz: e037c248b2141330bb307387325cf761f8036e10e91f18785386d219de891eb3ada221670bafa47fffcbe74f3109f21f9b8b8e356f6a132d6310d3dc12949c89
7
+ data.tar.gz: c61ab972f3fbdd7a58c9304a1eeb210c75f4016f3911645f8d72888c0b205aa59b5ea45505e45817d7096b86b0905b6987d8ed655ddaf24c676e161abd7ddf4c
@@ -28,7 +28,7 @@ module Quality
28
28
  out
29
29
  end
30
30
 
31
- def process_line
31
+ def process_line(&block)
32
32
  output =
33
33
  if emacs_format
34
34
  preprocess_line_for_emacs
@@ -36,7 +36,11 @@ module Quality
36
36
  @current_line
37
37
  end
38
38
  @found_output = true
39
- @violations += yield @current_line
39
+ @violations += if block
40
+ yield @current_line
41
+ else
42
+ 1
43
+ end
40
44
  output
41
45
  end
42
46
 
@@ -15,9 +15,15 @@ module Quality
15
15
 
16
16
  extend Forwardable
17
17
 
18
- def_delegators(:@source_file_globber, :ruby_files, :python_files,
19
- :js_files, :source_and_doc_files, :source_files,
20
- :exclude_files=, :exclude_files)
18
+ def_delegators(:@source_file_globber,
19
+ :ruby_files,
20
+ :python_files,
21
+ :js_files,
22
+ :shell_files,
23
+ :source_and_doc_files,
24
+ :source_files,
25
+ :exclude_files=,
26
+ :exclude_files)
21
27
 
22
28
  def to_glob(files)
23
29
  "{#{files.join(',')}}"
@@ -69,6 +69,10 @@ module Quality
69
69
  language_files('Python')
70
70
  end
71
71
 
72
+ def shell_files
73
+ language_files('Shell')
74
+ end
75
+
72
76
  def js_files
73
77
  language_files('JavaScript')
74
78
  end
@@ -79,17 +79,20 @@ module Quality
79
79
  existing_violations
80
80
  end
81
81
 
82
+ def command_name(ancestor, name)
83
+ if ancestor.respond_to? :command_name
84
+ ancestor.command_name
85
+ else
86
+ name
87
+ end
88
+ end
89
+
82
90
  def tools
83
91
  self.class.ancestors.map do |ancestor|
84
92
  ancestor_name = ancestor.to_s
85
93
  next unless ancestor_name.start_with?('Quality::Tools::')
86
94
  name = ancestor.to_s.split('::').last.underscore
87
- command_name = if ancestor.respond_to? :command_name
88
- ancestor.command_name
89
- else
90
- name
91
- end
92
- [name, command_name]
95
+ [name, command_name(ancestor, name)]
93
96
  end.compact
94
97
  end
95
98
 
@@ -106,6 +109,7 @@ module Quality
106
109
  def_delegators :@config,
107
110
  :ruby_files,
108
111
  :python_files,
112
+ :shell_files,
109
113
  :source_files,
110
114
  :source_files_glob,
111
115
  :source_and_doc_files,
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Quality
4
+ module Tools
5
+ # Adds 'ShellCheck' tool support to quality gem
6
+ module Shellcheck
7
+ private
8
+
9
+ def shellcheck_args
10
+ "-fgcc -sbash #{shell_files.join(' ')}"
11
+ end
12
+
13
+ def quality_shellcheck
14
+ ratchet_quality_cmd('shellcheck',
15
+ args: shellcheck_args,
16
+ gives_error_code_on_no_relevant_code: true,
17
+ gives_error_code_on_violations: true)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -4,5 +4,5 @@
4
4
  # reek, flog, flay and rubocop and makes sure your numbers don't get
5
5
  # any worse over time.
6
6
  module Quality
7
- VERSION = '23.0.7'
7
+ VERSION = '24.0.0'
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.0.7
4
+ version: 24.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-10 00:00:00.000000000 Z
11
+ date: 2016-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -336,6 +336,7 @@ files:
336
336
  - lib/quality/tools/rails_best_practices.rb
337
337
  - lib/quality/tools/reek.rb
338
338
  - lib/quality/tools/rubocop.rb
339
+ - lib/quality/tools/shellcheck.rb
339
340
  - lib/quality/version.rb
340
341
  - lib/quality/which.rb
341
342
  - quality.gemspec