reek 3.0.0 → 3.0.1

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: da371c20978d5a436025bc2ecddc2df4582a9c7e
4
- data.tar.gz: 8aa3729d6814cba34e69ff9e1696ce93450221c6
3
+ metadata.gz: 4d5b829b54c2856a722ff2906a4d038f4ad3601f
4
+ data.tar.gz: 7ad7e5f417d336194b59f1b85b3a518d6b3c9f8c
5
5
  SHA512:
6
- metadata.gz: d15340c5aa637820c280d28008579ecc97f9de7a56bf74e47f6f217a9f593d3a1416dfa6757b4beb3900032c505eed91aa8fa21de94374ac1e2d1537706cbabb
7
- data.tar.gz: c49a1ae86f1265e493f6e5eff700e2d02c2849358a49db20d87d9c52498138da0ca38fd7bd83cb90d0c16cb7b19789aa43422b052910b145ac611d9421bc6bf8
6
+ metadata.gz: 78e6b08e5ddf25dd0489860320ecc7b8b6ff6e89333ba2051523f37ac7a6318ba1c8c13449cd7978b47118068f9ca773b72223b935393ac9a2a4e3604acfc43d
7
+ data.tar.gz: 9aa379ef6f5d621c8916e6c70acff7ad90ffec332458650e9474364b285eb6bd2379385a79d57ce8f59338c4cf91ea0636857e465bf50dc012afcefbc70cb313
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 3.0.1
2
+
3
+ * (troessner) Fix reek descending into hidden directories
4
+
1
5
  == 3.0.0
2
6
 
3
7
  * (troessner) Make directories excludable via configuration.
@@ -31,7 +31,7 @@ module Reek
31
31
  Find.find(given_path) do |path|
32
32
  pathname = Pathname.new(path)
33
33
  if pathname.directory?
34
- exclude_path?(pathname) ? Find.prune : next
34
+ exclude_path?(pathname) || hidden_directory?(pathname) ? Find.prune : next
35
35
  else
36
36
  relevant_paths << pathname
37
37
  end
@@ -51,6 +51,10 @@ module Reek
51
51
  def print_no_such_file_error(path)
52
52
  $stderr.puts "Error: No such file - #{path}"
53
53
  end
54
+
55
+ def hidden_directory?(pathname)
56
+ pathname.basename.to_s.start_with? '.'
57
+ end
54
58
  end
55
59
  end
56
60
  end
@@ -3,6 +3,6 @@ module Reek
3
3
  # This module holds the Reek version informations
4
4
  #
5
5
  module Version
6
- STRING = '3.0.0'
6
+ STRING = '3.0.1'
7
7
  end
8
8
  end
@@ -3,6 +3,25 @@ require_relative '../../../lib/reek/source/source_locator'
3
3
 
4
4
  RSpec.describe Reek::Source::SourceLocator do
5
5
  describe '#sources' do
6
+ context 'applied to hidden directories' do
7
+ let(:path) { 'spec/samples/source_with_hidden_directories' }
8
+ let(:expected_files) do
9
+ ['spec/samples/source_with_hidden_directories/uncommunicative_parameter_name.rb']
10
+ end
11
+ let(:files_that_are_expected_to_be_ignored) do
12
+ ['spec/samples/source_with_hidden_directories/.hidden/uncommunicative_method_name.rb']
13
+ end
14
+
15
+ it 'does not scan hidden directories' do
16
+ sources = described_class.new([path]).sources
17
+
18
+ expect(sources.map(&:path)).
19
+ not_to include(files_that_are_expected_to_be_ignored)
20
+
21
+ expect(sources.map(&:path)).to eq expected_files
22
+ end
23
+ end
24
+
6
25
  context 'exclude paths' do
7
26
  let(:config) { 'spec/samples/configuration/with_excluded_paths.reek' }
8
27
  let(:path) { 'spec/samples/source_with_exclude_paths' }
@@ -0,0 +1,5 @@
1
+ # Klass comment.
2
+ class Klass
3
+ def m
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ # Klass comment
2
+ class Klass
3
+ def method(a)
4
+ a + @x
5
+ end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reek
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-30 00:00:00.000000000 Z
13
+ date: 2015-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser
@@ -417,6 +417,8 @@ files:
417
417
  - spec/samples/source_with_exclude_paths/ignore_me/uncommunicative_method_name.rb
418
418
  - spec/samples/source_with_exclude_paths/nested/ignore_me_as_well/irresponsible_module.rb
419
419
  - spec/samples/source_with_exclude_paths/nested/uncommunicative_parameter_name.rb
420
+ - spec/samples/source_with_hidden_directories/.hidden/uncommunicative_method_name.rb
421
+ - spec/samples/source_with_hidden_directories/uncommunicative_parameter_name.rb
420
422
  - spec/samples/three_clean_files/clean_one.rb
421
423
  - spec/samples/three_clean_files/clean_three.rb
422
424
  - spec/samples/three_clean_files/clean_two.rb