reek 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/reek/source/source_locator.rb +5 -1
- data/lib/reek/version.rb +1 -1
- data/spec/reek/source/source_locator_spec.rb +19 -0
- data/spec/samples/source_with_hidden_directories/.hidden/uncommunicative_method_name.rb +5 -0
- data/spec/samples/source_with_hidden_directories/uncommunicative_parameter_name.rb +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d5b829b54c2856a722ff2906a4d038f4ad3601f
|
4
|
+
data.tar.gz: 7ad7e5f417d336194b59f1b85b3a518d6b3c9f8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e6b08e5ddf25dd0489860320ecc7b8b6ff6e89333ba2051523f37ac7a6318ba1c8c13449cd7978b47118068f9ca773b72223b935393ac9a2a4e3604acfc43d
|
7
|
+
data.tar.gz: 9aa379ef6f5d621c8916e6c70acff7ad90ffec332458650e9474364b285eb6bd2379385a79d57ce8f59338c4cf91ea0636857e465bf50dc012afcefbc70cb313
|
data/CHANGELOG
CHANGED
@@ -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
|
data/lib/reek/version.rb
CHANGED
@@ -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' }
|
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.
|
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-
|
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
|