clint_eastwood 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -2
- data/clint_eastwood.gemspec +2 -0
- data/config/{reek.yml → reek_config.reek} +0 -0
- data/lib/clint_eastwood.rb +24 -14
- data/lib/clint_eastwood/cli.rb +7 -1
- data/lib/clint_eastwood/version.rb +1 -1
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 169221fed1e959e60675dab79818e7d8a3aa21f4
|
4
|
+
data.tar.gz: 0502b7c41e7585ddf0eceeed2e24baa377204e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e21cce65e8376f3cb5acc6778d649d7c5a05b705040a9a1cd9e093f11cb5550efa9f6125f3f06475bbffbff8a1e0dd54af2aba75a4102cc1d713260907c3f2
|
7
|
+
data.tar.gz: 4d6654e31610ca5b899ecf70df748dac5f121bfcfd1545584c76b94979d453865753c089190c23af78eaa4099a3647cb2f807b034d93cd5a8d6faf73647fbfe9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clint_eastwood (0.0.
|
4
|
+
clint_eastwood (0.0.6)
|
5
|
+
flay (~> 2.8.0)
|
6
|
+
flog (~> 4.4.0)
|
5
7
|
rails_best_practices (~> 1.17.0)
|
6
8
|
reek (~> 4.2.3)
|
7
9
|
rubocop (~> 0.42.0)
|
@@ -31,12 +33,22 @@ GEM
|
|
31
33
|
thread_safe (~> 0.3, >= 0.3.1)
|
32
34
|
equalizer (0.0.11)
|
33
35
|
erubis (2.7.0)
|
36
|
+
flay (2.8.0)
|
37
|
+
erubis (~> 2.7.0)
|
38
|
+
path_expander (~> 1.0)
|
39
|
+
ruby_parser (~> 3.0)
|
40
|
+
sexp_processor (~> 4.0)
|
41
|
+
flog (4.4.0)
|
42
|
+
path_expander (~> 1.0)
|
43
|
+
ruby_parser (~> 3.1, > 3.1.0)
|
44
|
+
sexp_processor (~> 4.4)
|
34
45
|
i18n (0.7.0)
|
35
46
|
ice_nine (0.11.2)
|
36
|
-
json (
|
47
|
+
json (1.8.3)
|
37
48
|
minitest (5.9.0)
|
38
49
|
parser (2.3.1.2)
|
39
50
|
ast (~> 2.2)
|
51
|
+
path_expander (1.0.0)
|
40
52
|
powerpack (0.1.1)
|
41
53
|
rails_best_practices (1.17.0)
|
42
54
|
activesupport
|
@@ -60,6 +72,8 @@ GEM
|
|
60
72
|
ruby-progressbar (~> 1.7)
|
61
73
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
62
74
|
ruby-progressbar (1.8.1)
|
75
|
+
ruby_parser (3.8.2)
|
76
|
+
sexp_processor (~> 4.1)
|
63
77
|
sexp_processor (4.7.0)
|
64
78
|
thor (0.19.1)
|
65
79
|
thread_safe (0.3.5)
|
data/clint_eastwood.gemspec
CHANGED
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'rubocop', '~> 0.42.0'
|
26
26
|
spec.add_dependency 'thor', '~> 0.19.1'
|
27
27
|
spec.add_dependency 'rails_best_practices', '~> 1.17.0'
|
28
|
+
spec.add_dependency 'flog', '~> 4.4.0'
|
29
|
+
spec.add_dependency 'flay', '~> 2.8.0'
|
28
30
|
|
29
31
|
spec.executables = ['clint']
|
30
32
|
end
|
File without changes
|
data/lib/clint_eastwood.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'clint_eastwood/version'
|
2
|
+
require 'reek'
|
2
3
|
require 'rails_best_practices'
|
3
4
|
require_relative 'better_rails_best_practices.rb'
|
4
5
|
|
@@ -18,13 +19,15 @@ module ClintEastwood
|
|
18
19
|
# @param disable_rbp [Boolean] If true, this stops rails best practices from running
|
19
20
|
#
|
20
21
|
# @returns [TheEnforcer] A new enforcer object
|
21
|
-
def initialize(path, lint: nil, disable_reek: false, disable_rubocop: false, disable_rbp: false)
|
22
|
+
def initialize(path, lint: nil, disable_reek: false, disable_rubocop: false, disable_rbp: false, disable_flog: false, disable_flay: false)
|
22
23
|
gem_path = File.expand_path(File.dirname(__FILE__))
|
23
24
|
@config_path = File.join(gem_path, '../config')
|
24
25
|
|
25
26
|
@disable_rubocop = disable_rubocop
|
26
27
|
@disable_reek = disable_reek
|
27
28
|
@disable_rbp = disable_rbp
|
29
|
+
@disable_flog = disable_flog
|
30
|
+
@disable_flay = disable_flay
|
28
31
|
|
29
32
|
@base_path = path
|
30
33
|
@lint_paths = lint || %w(app lib config spec)
|
@@ -36,8 +39,10 @@ module ClintEastwood
|
|
36
39
|
reek_result = @disable_reek || reek
|
37
40
|
rubocop_result = @disable_rubocop || rubocop
|
38
41
|
rbp_result = @disable_rbp || rails_best_practices
|
42
|
+
flog_result = @disable_flog || flog
|
43
|
+
flay_result = @disable_flay || flay
|
39
44
|
|
40
|
-
reek_result && rubocop_result && rbp_result
|
45
|
+
reek_result && rubocop_result && rbp_result && flog_result && flay_result
|
41
46
|
end
|
42
47
|
|
43
48
|
private
|
@@ -51,18 +56,9 @@ module ClintEastwood
|
|
51
56
|
|
52
57
|
# Run reek
|
53
58
|
def reek
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
@lint_paths.each do |path|
|
59
|
-
reek_command << File.join(@base_path, path)
|
60
|
-
end
|
61
|
-
|
62
|
-
reek_command.concat ['--config', "#{@reek_config}"]
|
63
|
-
|
64
|
-
# Reek returns the number of errors, so make sure it's zero
|
65
|
-
Reek::CLI::Application.new(reek_command).execute == 0
|
59
|
+
paths = @lint_paths.map { |p| File.join(@base_path, p) }.join(' ')
|
60
|
+
configuration = locate_config('reek_config.reek')
|
61
|
+
system "bundle exec reek --config #{configuration} #{paths}"
|
66
62
|
end
|
67
63
|
|
68
64
|
# Run rubocop
|
@@ -82,5 +78,19 @@ module ClintEastwood
|
|
82
78
|
analyzer.output
|
83
79
|
analyzer.runner.errors.size == 0
|
84
80
|
end
|
81
|
+
|
82
|
+
# Run flog
|
83
|
+
def flog
|
84
|
+
paths = @lint_paths.map { |p| File.join(@base_path, p) }.join(' ')
|
85
|
+
|
86
|
+
system "bundle exec flog #{paths}"
|
87
|
+
end
|
88
|
+
|
89
|
+
# Run flay
|
90
|
+
def flay
|
91
|
+
paths = @lint_paths.map { |p| File.join(@base_path, p) }.join(' ')
|
92
|
+
|
93
|
+
system "bundle exec flay #{paths}"
|
94
|
+
end
|
85
95
|
end
|
86
96
|
end
|
data/lib/clint_eastwood/cli.rb
CHANGED
@@ -10,6 +10,8 @@ module ClintEastwood
|
|
10
10
|
option 'disable-rbp', type: :boolean
|
11
11
|
option 'disable-rubocop', type: :boolean
|
12
12
|
option 'disable-reek', type: :boolean
|
13
|
+
option 'disable-flog', type: :boolean
|
14
|
+
option 'disable-flay', type: :boolean
|
13
15
|
option 'warn', type: :boolean
|
14
16
|
|
15
17
|
default_task :lint
|
@@ -42,13 +44,17 @@ module ClintEastwood
|
|
42
44
|
disable_rbp = options['disable-rbp'] || false
|
43
45
|
disable_rubocop = options['disable-rubocop'] || false
|
44
46
|
disable_reek = options['disable-reek'] || false
|
47
|
+
disable_flog = options['disable-flog'] || false
|
48
|
+
disable_flay = options['disable-flay'] || false
|
45
49
|
|
46
50
|
ClintEastwood::TheEnforcer.new(
|
47
51
|
path,
|
48
52
|
lint: options[:lint],
|
49
53
|
disable_rbp: disable_rbp,
|
50
54
|
disable_rubocop: disable_rubocop,
|
51
|
-
disable_reek: disable_reek
|
55
|
+
disable_reek: disable_reek,
|
56
|
+
disable_flog: disable_flog,
|
57
|
+
disable_flay: disable_flay
|
52
58
|
)
|
53
59
|
end
|
54
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clint_eastwood
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Lorich
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.17.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: flog
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 4.4.0
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 4.4.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: flay
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.8.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.8.0
|
97
125
|
description: A simple way to run a series of linting tools with default configurations
|
98
126
|
matching cloudspace's best practices
|
99
127
|
email:
|
@@ -112,7 +140,7 @@ files:
|
|
112
140
|
- bin/clint
|
113
141
|
- clint_eastwood.gemspec
|
114
142
|
- config/rails_best_practices.yml
|
115
|
-
- config/reek
|
143
|
+
- config/reek_config.reek
|
116
144
|
- config/rubocop.yml
|
117
145
|
- lib/better_rails_best_practices.rb
|
118
146
|
- lib/clint_eastwood.rb
|