reek 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/reek/source/source_locator.rb +11 -3
- data/lib/reek/version.rb +1 -1
- data/spec/reek/source/source_locator_spec.rb +22 -0
- data/spec/samples/source_with_non_ruby_files/gibberish +1 -0
- data/spec/samples/source_with_non_ruby_files/python_source.py +1 -0
- data/spec/samples/source_with_non_ruby_files/uncommunicative_parameter_name.rb +6 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71abe096497ff72ac2b0ff61c0264cde02d49ff3
|
4
|
+
data.tar.gz: 03e5768e1b53aef97a23e47d985daceb3f7316dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e8b1c75ccd4d2982825ee6f066a834dc602b8d370179740d2a79645bd5ae1c3974ffb466560dc0e4962393f203efb7e8cb603afb22ebd37913d11eb91348c44
|
7
|
+
data.tar.gz: c12a018c2777291fdcaaf93d3220b8d3abf193542cbe13763017c982473afa1e22767c3595cca3efe8e64c170954165b4a616412daff0822e1a053e0e8ed6fd5
|
data/CHANGELOG
CHANGED
@@ -31,16 +31,16 @@ module Reek
|
|
31
31
|
Find.find(given_path) do |path|
|
32
32
|
pathname = Pathname.new(path)
|
33
33
|
if pathname.directory?
|
34
|
-
|
34
|
+
ignore_path?(pathname) ? Find.prune : next
|
35
35
|
else
|
36
|
-
relevant_paths << pathname
|
36
|
+
relevant_paths << pathname if ruby_file?(pathname)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
40
|
relevant_paths.flatten.sort
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def path_excluded?(pathname)
|
44
44
|
Configuration::AppConfiguration.exclude_paths.include? pathname.to_s
|
45
45
|
end
|
46
46
|
|
@@ -55,6 +55,14 @@ module Reek
|
|
55
55
|
def hidden_directory?(pathname)
|
56
56
|
pathname.basename.to_s.start_with? '.'
|
57
57
|
end
|
58
|
+
|
59
|
+
def ignore_path?(pathname)
|
60
|
+
path_excluded?(pathname) || hidden_directory?(pathname)
|
61
|
+
end
|
62
|
+
|
63
|
+
def ruby_file?(pathname)
|
64
|
+
pathname.to_s.end_with?('.rb')
|
65
|
+
end
|
58
66
|
end
|
59
67
|
end
|
60
68
|
end
|
data/lib/reek/version.rb
CHANGED
@@ -45,5 +45,27 @@ RSpec.describe Reek::Source::SourceLocator do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
context 'non-ruby files' do
|
50
|
+
let(:path) { 'spec/samples/source_with_non_ruby_files' }
|
51
|
+
let(:expected_files) do
|
52
|
+
['spec/samples/source_with_non_ruby_files/uncommunicative_parameter_name.rb']
|
53
|
+
end
|
54
|
+
let(:files_that_are_expected_to_be_ignored) do
|
55
|
+
[
|
56
|
+
'spec/samples/source_with_non_ruby_files/gibberish',
|
57
|
+
'spec/samples/source_with_non_ruby_files/python_source.py'
|
58
|
+
]
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'does only use ruby source files' do
|
62
|
+
sources = described_class.new([path]).sources
|
63
|
+
|
64
|
+
expect(sources.map(&:path)).
|
65
|
+
not_to include(files_that_are_expected_to_be_ignored)
|
66
|
+
|
67
|
+
expect(sources.map(&:path)).to eq expected_files
|
68
|
+
end
|
69
|
+
end
|
48
70
|
end
|
49
71
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
adfasfsadfasdfsafsad
|
@@ -0,0 +1 @@
|
|
1
|
+
print("Hello, World!")
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Rutherford
|
@@ -419,6 +419,9 @@ files:
|
|
419
419
|
- spec/samples/source_with_exclude_paths/nested/uncommunicative_parameter_name.rb
|
420
420
|
- spec/samples/source_with_hidden_directories/.hidden/uncommunicative_method_name.rb
|
421
421
|
- spec/samples/source_with_hidden_directories/uncommunicative_parameter_name.rb
|
422
|
+
- spec/samples/source_with_non_ruby_files/gibberish
|
423
|
+
- spec/samples/source_with_non_ruby_files/python_source.py
|
424
|
+
- spec/samples/source_with_non_ruby_files/uncommunicative_parameter_name.rb
|
422
425
|
- spec/samples/three_clean_files/clean_one.rb
|
423
426
|
- spec/samples/three_clean_files/clean_three.rb
|
424
427
|
- spec/samples/three_clean_files/clean_two.rb
|