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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec33a1c32385f0cbfdefeaa9129d913496b1ae5c
4
- data.tar.gz: dee2aa84cf1b44b413d269c9f245376922a20519
3
+ metadata.gz: 9808a80e4acec1d11ff047566ab93b3f9970fbf8
4
+ data.tar.gz: 9aa277fd09847ff8164136143821fe756922f30b
5
5
  SHA512:
6
- metadata.gz: 1a5d63349c3a3cf426b70edfb3ffc5bf28a6c6d469fd4e725aed83633e7b6e0d3ccc7ab708c9fabaabb73afb4e7984b08b00885456f6c2bf1499248b84f3bbe5
7
- data.tar.gz: afe13be04b5e8cf03258f08fb1cb82403a99e41afa092bdc26e57a4e254d850ee5e047a2739e0e48a1032b54c680c8061c260fcead134439308d067c034aa864
6
+ metadata.gz: 99ed2a9703e405fa3cf562f44e10a577a5d03b2c1a12738ad5dfbb677afbff6a4b0729ef1a0c21ba7030214e463d8d43f4a2f9021cc8027bf1681076b3a1daee
7
+ data.tar.gz: 7347e0315bb8964d3e19815538176117045cf0900f9796917efcd186e5cbbeffb0de0640127ecb7447e3e39d5173cd1efb298d372589d1f34170a44b49c0861a
@@ -7,6 +7,10 @@ AllCops:
7
7
  Exclude:
8
8
  - 'test/samples/**/*'
9
9
  - 'tmp/**/*'
10
+ - 'vendor/**/*'
11
+
12
+ Metrics/BlockLength:
13
+ Enabled: false
10
14
 
11
15
  Metrics/LineLength:
12
16
  Max: 120
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?
@@ -1,25 +1,20 @@
1
1
  sudo: false
2
2
  language: ruby
3
-
4
- rvm:
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.0.5.0
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
@@ -1,3 +1,7 @@
1
+ # 3.0.0 / 2016-11-01
2
+
3
+ * [CHANGE] Set required ruby version to 2.1 (by Onumis)
4
+ * [BUGFIX] Respect the .reek configuration file (by mereghost)
1
5
 
2
6
  # 2.9.4 / 2016-09-16
3
7
 
@@ -3,5 +3,8 @@ require 'reek'
3
3
 
4
4
  module RubyCritic
5
5
  class Reek < ::Reek::Examiner
6
+ def initialize(analysed_module)
7
+ super(analysed_module, configuration: ::Reek::Configuration::AppConfiguration.from_path)
8
+ end
6
9
  end
7
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'colorize'
2
+ require 'rainbow'
3
3
 
4
4
  module RubyCritic
5
5
  module Generator
@@ -1,5 +1,5 @@
1
- <%= @analysed_module.name.colorize(color) %>:
2
- Rating: <%= @analysed_module.rating.to_s.colorize(color) %>
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 %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCritic
4
- VERSION = '2.9.4'.freeze
4
+ VERSION = '3.0.0'.freeze
5
5
  end
@@ -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.0.0'
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 'colorize'
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
@@ -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: 2.9.4
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-09-16 00:00:00.000000000 Z
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: colorize
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.0.0
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.5.1
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