reek 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/features/configuration_files/directory_specific_directives.feature +0 -16
- data/lib/reek/configuration/configuration_validator.rb +1 -10
- data/lib/reek/version.rb +1 -1
- data/spec/reek/configuration/directory_directives_spec.rb +0 -11
- data/spec/reek/configuration/excluded_paths_spec.rb +0 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa22fd6869d0e417b1a06439dfe1708b19681806
|
4
|
+
data.tar.gz: 64206ff481be4eec7b81f104414b8adfe20368c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d1059a61327c5541cb78cc9d03eb14e09c07ecd282c4231ab84f18afc98aa627b581238e960d23d061b22dd6e18a1cc3b0a0e99c3d9928dc7adecdbd6466eec
|
7
|
+
data.tar.gz: 849705c263f676c58fc845ccfdad492ee807fc28e1f7e20fa6a5fbd6b146aa69325f909bfdf6bf07a063c9a3172e494cbb0390e49c328e765293d32135ccde0e
|
data/CHANGELOG.md
CHANGED
@@ -170,22 +170,6 @@ Feature: Directory directives
|
|
170
170
|
2 total warnings
|
171
171
|
"""
|
172
172
|
|
173
|
-
Scenario: Abort on non-existent directory
|
174
|
-
Given a file named "config.reek" with:
|
175
|
-
"""
|
176
|
-
---
|
177
|
-
"does/not/exist":
|
178
|
-
NestedIterators:
|
179
|
-
enabled: false
|
180
|
-
"""
|
181
|
-
When I run `reek -c config.reek lib/`
|
182
|
-
Then the exit status indicates an error
|
183
|
-
And stderr reports:
|
184
|
-
"""
|
185
|
-
Configuration error: Directory `does/not/exist` does not exist
|
186
|
-
|
187
|
-
"""
|
188
|
-
|
189
173
|
Scenario: Abort on non-existent smell type in directory directive
|
190
174
|
Given a file named "config.reek" with:
|
191
175
|
"""
|
@@ -30,22 +30,13 @@ module Reek
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def error_message_for_missing_directory(pathname)
|
34
|
-
"Configuration error: Directory `#{pathname}` does not exist"
|
35
|
-
end
|
36
|
-
|
37
33
|
def error_message_for_file_given(pathname)
|
38
34
|
"Configuration error: `#{pathname}` is supposed to be a directory but is a file"
|
39
35
|
end
|
40
36
|
|
41
|
-
def validate_directory(pathname)
|
42
|
-
abort(error_message_for_missing_directory(pathname)) unless pathname.exist?
|
43
|
-
abort(error_message_for_file_given(pathname)) if pathname.file?
|
44
|
-
end
|
45
|
-
|
46
37
|
def with_valid_directory(path)
|
47
38
|
directory = Pathname.new path.to_s.chomp('/')
|
48
|
-
|
39
|
+
abort(error_message_for_file_given(directory)) if directory.file?
|
49
40
|
yield directory if block_given?
|
50
41
|
end
|
51
42
|
end
|
data/lib/reek/version.rb
CHANGED
@@ -30,17 +30,6 @@ RSpec.describe Reek::Configuration::DirectoryDirectives do
|
|
30
30
|
subject do
|
31
31
|
{}.extend(described_class)
|
32
32
|
end
|
33
|
-
let(:empty_config) { Hash.new }
|
34
|
-
|
35
|
-
context 'one of given paths does not exist' do
|
36
|
-
let(:bogus_path) { Pathname('does/not/exist') }
|
37
|
-
|
38
|
-
it 'raises an error' do
|
39
|
-
Reek::CLI::Silencer.silently do
|
40
|
-
expect { subject.add(bogus_path, {}) }.to raise_error(SystemExit)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
33
|
|
45
34
|
context 'one of given paths is a file' do
|
46
35
|
let(:file_as_path) { SAMPLES_PATH.join('inline.rb') }
|
@@ -5,17 +5,6 @@ RSpec.describe Reek::Configuration::ExcludedPaths do
|
|
5
5
|
describe '#add' do
|
6
6
|
subject { [].extend(described_class) }
|
7
7
|
|
8
|
-
context 'one of the given paths does not exist' do
|
9
|
-
let(:bogus_path) { Pathname('does/not/exist') }
|
10
|
-
let(:paths) { [SAMPLES_PATH, bogus_path] }
|
11
|
-
|
12
|
-
it 'raises an error' do
|
13
|
-
Reek::CLI::Silencer.silently do
|
14
|
-
expect { subject.add(paths) }.to raise_error(SystemExit)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
8
|
context 'one of given paths is a file' do
|
20
9
|
let(:file_as_path) { SAMPLES_PATH.join('inline.rb') }
|
21
10
|
let(:paths) { [SAMPLES_PATH, file_as_path] }
|