rubycritic 2.8.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.todo.reek +1 -0
- data/.travis.yml +0 -1
- data/CHANGELOG.md +8 -0
- data/README.md +4 -2
- data/lib/rubycritic/analysers/smells/flay.rb +1 -0
- data/lib/rubycritic/analysers/smells/flog.rb +1 -0
- data/lib/rubycritic/analysers/smells/reek.rb +1 -0
- data/lib/rubycritic/core/smell.rb +14 -1
- data/lib/rubycritic/rake_task.rb +0 -1
- data/lib/rubycritic/version.rb +1 -1
- data/rubycritic.gemspec +3 -3
- data/test/lib/rubycritic/core/smell_test.rb +21 -4
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dbaa6b17360c86029115d0519f0f0219ca5bc1d
|
4
|
+
data.tar.gz: ae570da462c045f67baa3a18bc7fc68ea4713561
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 623d51c7a505561830c35cdf90cc75a9102a1da66cc050b1e125f7f5cd0cef659b1d146714b186e9a591b72089855c4664e4322b3fdc659b64210458e34a6985
|
7
|
+
data.tar.gz: b22749541a3981cd8109d20cf098c4e7be6ed4e10e03c43fe67dcf024b28546ac4688ba08c739c4e1b9db6d8ca19606e3b7d30c98bf9e577323df2c80916fcec
|
data/.todo.reek
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 2.9.0 / 2016-04-12
|
2
|
+
|
3
|
+
* [FEATURE] Add links to Flay and Flog code smells documentation (by ragesoss)
|
4
|
+
* [FEATURE] Documentation updates (by troessner)
|
5
|
+
* [CHANGE] Bump Rubocop to 0.39.0 (by nijikon)
|
6
|
+
* [CHANGE] Bump Reek to 4.0.1 (by nijikon)
|
7
|
+
* [CHANGE] Drop support for Ruby 2.0 (by nijikon)
|
8
|
+
|
1
9
|
# 2.8.0 / 2016-02-29
|
2
10
|
|
3
11
|
* [FEATURE] Add link to Reek's code smells documentation (by danielmbarlow)
|
data/README.md
CHANGED
@@ -108,7 +108,10 @@ Analyzer Configuration
|
|
108
108
|
This means that if you have an existing `Reek` configuration file, you can just put this into your
|
109
109
|
project root and `RubyCritic` will respect this configuration.
|
110
110
|
* [`flay`](https://github.com/seattlerb/flay): We use `flay`'s default configuration.
|
111
|
-
* [`flog`](https://github.com/seattlerb/flog): We use `flog`'s default configuration with a couple of [smaller tweaks](https://github.com/whitesmith/rubycritic/blob/master/lib/rubycritic/analysers/helpers/flog.rb#L5)
|
111
|
+
* [`flog`](https://github.com/seattlerb/flog): We use `flog`'s default configuration with a couple of [smaller tweaks](https://github.com/whitesmith/rubycritic/blob/master/lib/rubycritic/analysers/helpers/flog.rb#L5):
|
112
|
+
* `all`: Forces `flog` to report scores on all classes and methods. Without this option `flog` will only give results up to a certain threshold.
|
113
|
+
* `continue`: Makes it so that `flog` does not abort when a ruby file cannot be parsed.
|
114
|
+
* `methods`: Configures `flog` to skip code outside of methods. It prevents `flog` from reporting on the "methods" `private` and `protected`. It also prevents `flog` from reporting on Rails methods like `before_action` and `has_many`.
|
112
115
|
|
113
116
|
Alternative Usage Methods
|
114
117
|
-------------------------
|
@@ -161,7 +164,6 @@ Compatibility
|
|
161
164
|
|
162
165
|
RubyCritic is supporting:
|
163
166
|
|
164
|
-
* 2.0
|
165
167
|
* 2.1
|
166
168
|
* 2.2
|
167
169
|
* 2.3
|
@@ -12,6 +12,10 @@ module Rubycritic
|
|
12
12
|
attribute :score
|
13
13
|
attribute :status
|
14
14
|
attribute :type
|
15
|
+
attribute :analyser
|
16
|
+
|
17
|
+
FLAY_DOCS_URL = 'http://docs.seattlerb.org/flay/'.freeze
|
18
|
+
FLOG_DOCS_URL = 'http://docs.seattlerb.org/flog/'.freeze
|
15
19
|
|
16
20
|
def at_location?(other_location)
|
17
21
|
locations.any? { |location| location == other_location }
|
@@ -47,7 +51,16 @@ module Rubycritic
|
|
47
51
|
end
|
48
52
|
|
49
53
|
def doc_url
|
50
|
-
|
54
|
+
case analyser
|
55
|
+
when 'reek'
|
56
|
+
"https://github.com/troessner/reek/blob/master/docs/#{dasherized_type}.md"
|
57
|
+
when 'flay'
|
58
|
+
FLAY_DOCS_URL
|
59
|
+
when 'flog'
|
60
|
+
FLOG_DOCS_URL
|
61
|
+
else
|
62
|
+
raise "No documentation URL set for analyser '#{analyser}' smells"
|
63
|
+
end
|
51
64
|
end
|
52
65
|
|
53
66
|
def hash
|
data/lib/rubycritic/rake_task.rb
CHANGED
data/lib/rubycritic/version.rb
CHANGED
data/rubycritic.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency 'virtus', '~> 1.0'
|
24
24
|
spec.add_runtime_dependency 'flay', '2.7.0'
|
25
25
|
spec.add_runtime_dependency 'flog', '4.3.2'
|
26
|
-
spec.add_runtime_dependency 'reek', '
|
27
|
-
spec.add_runtime_dependency 'parser', '
|
26
|
+
spec.add_runtime_dependency 'reek', '4.0.1'
|
27
|
+
spec.add_runtime_dependency 'parser', '2.3.0.7'
|
28
28
|
spec.add_runtime_dependency 'ruby_parser', '~> 3.8'
|
29
29
|
spec.add_runtime_dependency 'colorize'
|
30
30
|
spec.add_runtime_dependency 'launchy', '2.4.3'
|
@@ -35,6 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency 'rake'
|
36
36
|
spec.add_development_dependency 'minitest', '~> 5.3'
|
37
37
|
spec.add_development_dependency 'mocha', '~> 1.1'
|
38
|
-
spec.add_development_dependency 'rubocop', '0.
|
38
|
+
spec.add_development_dependency 'rubocop', '0.39.0'
|
39
39
|
spec.add_development_dependency 'pry-byebug'
|
40
40
|
end
|
@@ -71,16 +71,33 @@ describe Rubycritic::Smell do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
describe '#doc_url' do
|
74
|
-
it 'handles one word type names' do
|
75
|
-
smell = Rubycritic::Smell.new(type: 'Complexity')
|
74
|
+
it 'handles one word type names for reek smells' do
|
75
|
+
smell = Rubycritic::Smell.new(type: 'Complexity', analyser: 'reek')
|
76
76
|
|
77
77
|
smell.doc_url.must_equal('https://github.com/troessner/reek/blob/master/docs/Complexity.md')
|
78
78
|
end
|
79
79
|
|
80
|
-
it 'handles multiple word type names' do
|
81
|
-
smell = Rubycritic::Smell.new(type: 'TooManyStatements')
|
80
|
+
it 'handles multiple word type names for reek smells' do
|
81
|
+
smell = Rubycritic::Smell.new(type: 'TooManyStatements', analyser: 'reek')
|
82
82
|
|
83
83
|
smell.doc_url.must_equal('https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md')
|
84
84
|
end
|
85
|
+
|
86
|
+
it 'handles flay smells' do
|
87
|
+
smell = Rubycritic::Smell.new(type: 'DuplicateCode', analyser: 'flay')
|
88
|
+
|
89
|
+
smell.doc_url.must_equal('http://docs.seattlerb.org/flay/')
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'handles flog smells' do
|
93
|
+
smell = Rubycritic::Smell.new(type: 'VeryHighComplexity', analyser: 'flog')
|
94
|
+
|
95
|
+
smell.doc_url.must_equal('http://docs.seattlerb.org/flog/')
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'raises an error for unknown analysers' do
|
99
|
+
smell = Rubycritic::Smell.new(type: 'FooSmell', analyser: 'foo')
|
100
|
+
assert_raises { smell.doc_url }
|
101
|
+
end
|
85
102
|
end
|
86
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Simoes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 4.0.1
|
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:
|
68
|
+
version: 4.0.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: parser
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.3.0.7
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 2.3.0.7
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: ruby_parser
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +212,14 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - '='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 0.
|
215
|
+
version: 0.39.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - '='
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 0.
|
222
|
+
version: 0.39.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: pry-byebug
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -454,3 +454,4 @@ test_files:
|
|
454
454
|
- test/samples/reek/smelly.rb
|
455
455
|
- test/samples/unparsable.rb
|
456
456
|
- test/test_helper.rb
|
457
|
+
has_rdoc:
|