rubycritic 2.9.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.todo.reek +2 -1
- data/.travis.yml +12 -17
- data/CHANGELOG.md +4 -0
- data/lib/rubycritic/analysers/helpers/reek.rb +3 -0
- data/lib/rubycritic/generators/text/list.rb +1 -1
- data/lib/rubycritic/generators/text/templates/list.erb +2 -2
- data/lib/rubycritic/version.rb +1 -1
- data/rubycritic.gemspec +2 -3
- data/test/lib/rubycritic/analysers/smells/reek_test.rb +5 -0
- data/test/samples/location/file0_symlink.rb +0 -0
- data/test/samples/reek/smelly.rb +5 -0
- metadata +6 -19
- data/test/samples/location/file0_symlink.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9808a80e4acec1d11ff047566ab93b3f9970fbf8
|
4
|
+
data.tar.gz: 9aa277fd09847ff8164136143821fe756922f30b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99ed2a9703e405fa3cf562f44e10a577a5d03b2c1a12738ad5dfbb677afbff6a4b0729ef1a0c21ba7030214e463d8d43f4a2f9021cc8027bf1681076b3a1daee
|
7
|
+
data.tar.gz: 7347e0315bb8964d3e19815538176117045cf0900f9796917efcd186e5cbbeffb0de0640127ecb7447e3e39d5173cd1efb298d372589d1f34170a44b49c0861a
|
data/.rubocop.yml
CHANGED
data/.todo.reek
CHANGED
@@ -133,9 +133,10 @@ UncommunicativeParameterName:
|
|
133
133
|
- RubyCritic::Location#to_json
|
134
134
|
- RubyCritic::Rating#to_json
|
135
135
|
- RubyCritic::Smell#to_json
|
136
|
+
- Theon # This is needed for the tests to pass
|
136
137
|
ClassVariable:
|
137
138
|
exclude:
|
138
139
|
- RubyCritic::SourceControlSystem::Base
|
139
|
-
BooleanParameter:
|
140
|
+
BooleanParameter:
|
140
141
|
exclude:
|
141
142
|
- RubyCritic::Config#self.respond_to_missing?
|
data/.travis.yml
CHANGED
@@ -1,25 +1,20 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
-
|
4
|
-
|
5
|
-
- 2.1.8
|
6
|
-
- 2.2.4
|
7
|
-
- 2.3.0
|
8
|
-
- ruby-head
|
9
|
-
- jruby-9.0.5.0
|
10
|
-
- rbx-3
|
11
|
-
|
12
|
-
env:
|
13
|
-
# this doesn't do anything for MRI or RBX, but it doesn't hurt them either
|
14
|
-
# for JRuby, it enables us to get more accurate coverage data
|
15
|
-
- JRUBY_OPTS="--debug"
|
16
|
-
|
3
|
+
cache: bundler
|
4
|
+
before_install: gem update bundler
|
17
5
|
matrix:
|
6
|
+
include:
|
7
|
+
- rvm: 2.1.0
|
8
|
+
- rvm: 2.1.10
|
9
|
+
- rvm: 2.2.5
|
10
|
+
- rvm: 2.3.1
|
11
|
+
- rvm: ruby-head
|
12
|
+
- rvm: jruby-9.1.5.0
|
13
|
+
env: JRUBY_OPTS='--debug' # get more accurate coverage data
|
14
|
+
- rvm: rbx-3
|
18
15
|
allow_failures:
|
19
16
|
- rvm: ruby-head
|
20
|
-
- rvm: jruby-9.
|
17
|
+
- rvm: jruby-9.1.5.0
|
21
18
|
- rvm: rbx-3
|
22
19
|
fast_finish: true
|
23
|
-
|
24
|
-
before_install: gem update bundler
|
25
20
|
script: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= @analysed_module.name.
|
2
|
-
Rating: <%= @analysed_module.rating.to_s.
|
1
|
+
<%= Rainbow(@analysed_module.name.to_s).foreground(color) %>:
|
2
|
+
Rating: <%= Rainbow(@analysed_module.rating.to_s).foreground(color) %>
|
3
3
|
Churn: <%= @analysed_module.churn %>
|
4
4
|
Complexity: <%= @analysed_module.complexity %>
|
5
5
|
Duplication: <%= @analysed_module.duplication %>
|
data/lib/rubycritic/version.rb
CHANGED
data/rubycritic.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.summary = 'RubyCritic is a Ruby code quality reporter'
|
15
15
|
spec.homepage = 'https://github.com/whitesmith/rubycritic'
|
16
16
|
spec.license = 'MIT'
|
17
|
-
spec.required_ruby_version = '>= 2.
|
17
|
+
spec.required_ruby_version = '>= 2.1.0'
|
18
18
|
|
19
19
|
spec.files = `git ls-files`.split("\n")
|
20
20
|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_runtime_dependency 'reek', '~> 4.4'
|
28
28
|
spec.add_runtime_dependency 'parser', '2.3.1.2'
|
29
29
|
spec.add_runtime_dependency 'ruby_parser', '~> 3.8'
|
30
|
-
spec.add_runtime_dependency '
|
30
|
+
spec.add_runtime_dependency 'rainbow'
|
31
31
|
spec.add_runtime_dependency 'launchy', '2.4.3'
|
32
32
|
|
33
33
|
spec.add_development_dependency 'aruba'
|
@@ -38,5 +38,4 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_development_dependency 'minitest', '~> 5.3'
|
39
39
|
spec.add_development_dependency 'mocha', '~> 1.1'
|
40
40
|
spec.add_development_dependency 'rubocop', '>= 0.42.0'
|
41
|
-
spec.add_development_dependency 'pry-byebug'
|
42
41
|
end
|
@@ -15,6 +15,11 @@ describe RubyCritic::Analyser::ReekSmells do
|
|
15
15
|
@analysed_module.smells.length.must_equal 2
|
16
16
|
end
|
17
17
|
|
18
|
+
it 'respects the .reek file' do
|
19
|
+
messages = @analysed_module.smells.map(&:message)
|
20
|
+
messages.wont_include "has the parameter name 'a'"
|
21
|
+
end
|
22
|
+
|
18
23
|
it 'creates smells with messages' do
|
19
24
|
first_smell = @analysed_module.smells.first
|
20
25
|
first_smell.message.must_equal "has boolean parameter 'reek'"
|
File without changes
|
data/test/samples/reek/smelly.rb
CHANGED
@@ -2,6 +2,10 @@ class Theon
|
|
2
2
|
def reeks?(reek = true)
|
3
3
|
reek
|
4
4
|
end
|
5
|
+
|
6
|
+
def flayed?(a)
|
7
|
+
a
|
8
|
+
end
|
5
9
|
end
|
6
10
|
|
7
11
|
# Reek should report
|
@@ -10,3 +14,4 @@ end
|
|
10
14
|
# This comment is below the module because otherwise Reek will interpret this
|
11
15
|
# as a comment describing the module which would thus prevent
|
12
16
|
# IrresponsibleModule from being reported.
|
17
|
+
# It should ignore the UncommunicativeParameterName as it's on the .todo.reek
|
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:
|
4
|
+
version: 3.0.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-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.8'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rainbow
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -234,20 +234,6 @@ dependencies:
|
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: 0.42.0
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: pry-byebug
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - ">="
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: '0'
|
244
|
-
type: :development
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - ">="
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: '0'
|
251
237
|
description: RubyCritic is a tool that wraps around various static analysis gems to
|
252
238
|
provide a quality report of your Ruby code.
|
253
239
|
email:
|
@@ -412,7 +398,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
412
398
|
requirements:
|
413
399
|
- - ">="
|
414
400
|
- !ruby/object:Gem::Version
|
415
|
-
version: 2.
|
401
|
+
version: 2.1.0
|
416
402
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
417
403
|
requirements:
|
418
404
|
- - ">="
|
@@ -420,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
420
406
|
version: '0'
|
421
407
|
requirements: []
|
422
408
|
rubyforge_project:
|
423
|
-
rubygems_version: 2.
|
409
|
+
rubygems_version: 2.4.8
|
424
410
|
signing_key:
|
425
411
|
specification_version: 4
|
426
412
|
summary: RubyCritic is a Ruby code quality reporter
|
@@ -472,3 +458,4 @@ test_files:
|
|
472
458
|
- test/samples/reek/smelly.rb
|
473
459
|
- test/samples/unparsable.rb
|
474
460
|
- test/test_helper.rb
|
461
|
+
has_rdoc:
|
@@ -1 +0,0 @@
|
|
1
|
-
file0.rb
|