reek 4.8.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{samples/configuration/more_than_one_configuration_file/regular.reek → .reek.yml} +0 -0
- data/.rubocop.yml +17 -3
- data/.simplecov +1 -0
- data/.travis.yml +0 -5
- data/.yardopts +1 -1
- data/CHANGELOG.md +28 -0
- data/Gemfile +1 -1
- data/README.md +113 -98
- data/Rakefile +16 -3
- data/bin/reek +1 -3
- data/docs/API.md +2 -9
- data/docs/Basic-Smell-Options.md +51 -11
- data/docs/Code-Smells.md +1 -1
- data/docs/Command-Line-Options.md +14 -4
- data/docs/Duplicate-Method-Call.md +49 -1
- data/docs/Feature-Envy.md +44 -0
- data/docs/How-To-Write-New-Detectors.md +2 -3
- data/docs/{Prima-Donna-Method.md → Missing-Safe-Method.md} +11 -9
- data/docs/Rake-Task.md +1 -1
- data/docs/Reek-4-to-Reek-5-migration.md +193 -0
- data/docs/Reek-Driven-Development.md +1 -1
- data/docs/Uncommunicative-Method-Name.md +43 -4
- data/docs/Uncommunicative-Module-Name.md +48 -6
- data/docs/Uncommunicative-Parameter-Name.md +42 -4
- data/docs/Uncommunicative-Variable-Name.md +73 -2
- data/docs/Unused-Private-Method.md +1 -1
- data/docs/defaults.reek.yml +129 -0
- data/docs/yard_plugin.rb +1 -0
- data/features/command_line_interface/options.feature +46 -4
- data/features/command_line_interface/stdin.feature +27 -5
- data/features/configuration_files/accept_setting.feature +39 -22
- data/features/configuration_files/directory_specific_directives.feature +58 -53
- data/features/configuration_files/exclude_directives.feature +8 -7
- data/features/configuration_files/masking_smells.feature +35 -6
- data/features/configuration_files/mix_accept_reject_setting.feature +24 -21
- data/features/configuration_files/reject_setting.feature +45 -34
- data/features/configuration_files/schema_validation.feature +59 -0
- data/features/configuration_files/unused_private_method.feature +14 -12
- data/features/configuration_loading.feature +50 -7
- data/features/rake_task/rake_task.feature +5 -5
- data/features/reports/json.feature +4 -1
- data/features/reports/reports.feature +12 -12
- data/features/reports/yaml.feature +3 -0
- data/features/rspec_matcher.feature +9 -1
- data/features/step_definitions/reek_steps.rb +4 -0
- data/features/step_definitions/sample_file_steps.rb +9 -4
- data/features/support/env.rb +2 -2
- data/features/todo_list.feature +16 -13
- data/lib/reek/ast/node.rb +3 -6
- data/lib/reek/ast/object_refs.rb +1 -1
- data/lib/reek/ast/sexp_extensions/if.rb +1 -1
- data/lib/reek/ast/sexp_extensions/methods.rb +1 -1
- data/lib/reek/cli/application.rb +4 -3
- data/lib/reek/cli/command/report_command.rb +1 -2
- data/lib/reek/cli/command/todo_list_command.rb +4 -2
- data/lib/reek/cli/options.rb +27 -13
- data/lib/reek/cli/silencer.rb +14 -3
- data/lib/reek/code_comment.rb +14 -16
- data/lib/reek/configuration/app_configuration.rb +32 -28
- data/lib/reek/configuration/configuration_converter.rb +110 -0
- data/lib/reek/configuration/configuration_file_finder.rb +15 -40
- data/lib/reek/configuration/configuration_validator.rb +12 -23
- data/lib/reek/configuration/default_directive.rb +17 -3
- data/lib/reek/configuration/directory_directives.rb +17 -11
- data/lib/reek/configuration/excluded_paths.rb +1 -1
- data/lib/reek/configuration/rake_task_converter.rb +29 -0
- data/lib/reek/configuration/schema.yml +210 -0
- data/lib/reek/configuration/schema_validator.rb +38 -0
- data/lib/reek/context/attribute_context.rb +1 -1
- data/lib/reek/context/code_context.rb +4 -4
- data/lib/reek/context/method_context.rb +2 -2
- data/lib/reek/context/module_context.rb +1 -1
- data/lib/reek/context_builder.rb +9 -9
- data/lib/reek/detector_repository.rb +6 -0
- data/lib/reek/documentation_link.rb +2 -2
- data/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb +1 -1
- data/lib/reek/errors/bad_detector_in_comment_error.rb +1 -1
- data/lib/reek/errors/config_file_error.rb +11 -0
- data/lib/reek/errors/encoding_error.rb +2 -2
- data/lib/reek/errors/garbage_detector_configuration_in_comment_error.rb +1 -1
- data/lib/reek/errors/incomprehensible_source_error.rb +2 -2
- data/lib/reek/errors/syntax_error.rb +41 -0
- data/lib/reek/examiner.rb +9 -19
- data/lib/reek/rake/task.rb +3 -3
- data/lib/reek/report.rb +15 -10
- data/lib/reek/report/base_report.rb +8 -12
- data/lib/reek/report/code_climate/code_climate_configuration.yml +5 -9
- data/lib/reek/report/documentation_link_warning_formatter.rb +17 -0
- data/lib/reek/report/heading_formatter.rb +54 -0
- data/lib/reek/report/json_report.rb +1 -1
- data/lib/reek/report/location_formatter.rb +40 -0
- data/lib/reek/report/progress_formatter.rb +79 -0
- data/lib/reek/report/simple_warning_formatter.rb +34 -0
- data/lib/reek/report/text_report.rb +1 -2
- data/lib/reek/report/xml_report.rb +3 -3
- data/lib/reek/report/yaml_report.rb +1 -1
- data/lib/reek/smell_configuration.rb +2 -2
- data/lib/reek/smell_detectors.rb +1 -2
- data/lib/reek/smell_detectors/attribute.rb +0 -1
- data/lib/reek/smell_detectors/base_detector.rb +8 -11
- data/lib/reek/smell_detectors/boolean_parameter.rb +0 -1
- data/lib/reek/smell_detectors/class_variable.rb +0 -1
- data/lib/reek/smell_detectors/control_parameter.rb +17 -32
- data/lib/reek/smell_detectors/data_clump.rb +3 -4
- data/lib/reek/smell_detectors/duplicate_method_call.rb +5 -6
- data/lib/reek/smell_detectors/feature_envy.rb +0 -1
- data/lib/reek/smell_detectors/instance_variable_assumption.rb +0 -1
- data/lib/reek/smell_detectors/irresponsible_module.rb +0 -1
- data/lib/reek/smell_detectors/long_parameter_list.rb +1 -2
- data/lib/reek/smell_detectors/long_yield_list.rb +2 -3
- data/lib/reek/smell_detectors/manual_dispatch.rb +2 -2
- data/lib/reek/smell_detectors/{prima_donna_method.rb → missing_safe_method.rb} +6 -7
- data/lib/reek/smell_detectors/module_initialize.rb +0 -1
- data/lib/reek/smell_detectors/nested_iterators.rb +4 -5
- data/lib/reek/smell_detectors/nil_check.rb +0 -1
- data/lib/reek/smell_detectors/repeated_conditional.rb +3 -4
- data/lib/reek/smell_detectors/subclassed_from_core_class.rb +0 -1
- data/lib/reek/smell_detectors/too_many_constants.rb +1 -2
- data/lib/reek/smell_detectors/too_many_instance_variables.rb +1 -2
- data/lib/reek/smell_detectors/too_many_methods.rb +1 -2
- data/lib/reek/smell_detectors/too_many_statements.rb +1 -2
- data/lib/reek/smell_detectors/uncommunicative_method_name.rb +2 -3
- data/lib/reek/smell_detectors/uncommunicative_module_name.rb +2 -3
- data/lib/reek/smell_detectors/uncommunicative_parameter_name.rb +2 -3
- data/lib/reek/smell_detectors/uncommunicative_variable_name.rb +4 -5
- data/lib/reek/smell_detectors/unused_parameters.rb +0 -1
- data/lib/reek/smell_detectors/unused_private_method.rb +0 -1
- data/lib/reek/smell_detectors/utility_function.rb +1 -2
- data/lib/reek/smell_warning.rb +10 -8
- data/lib/reek/source/source_code.rb +40 -55
- data/lib/reek/source/source_locator.rb +7 -7
- data/lib/reek/spec.rb +6 -6
- data/lib/reek/spec/should_reek.rb +2 -2
- data/lib/reek/spec/should_reek_of.rb +9 -16
- data/lib/reek/spec/should_reek_only_of.rb +4 -4
- data/lib/reek/tree_dresser.rb +5 -5
- data/lib/reek/version.rb +1 -1
- data/reek.gemspec +3 -3
- data/samples/checkstyle.xml +1 -1
- data/samples/{clean.rb → clean_source/clean.rb} +0 -0
- data/samples/configuration/accepts_rejects_and_excludes_for_detectors.reek.yml +29 -0
- data/samples/configuration/accepts_rejects_and_excludes_for_directory_directives.reek.yml +30 -0
- data/samples/configuration/full_configuration.reek +8 -4
- data/samples/configuration/full_mask.reek +5 -4
- data/samples/{exceptions.reek → configuration/home/home.reek.yml} +0 -0
- data/samples/configuration/partial_mask.reek +3 -2
- data/samples/configuration/regular_configuration/.reek.yml +4 -0
- data/samples/configuration/{more_than_one_configuration_file/todo.reek → regular_configuration/empty_sub_directory/.gitignore} +0 -0
- data/samples/{configuration/single_configuration_file/.reek → no_config_file/.keep} +0 -0
- data/samples/paths.rb +5 -4
- data/samples/{inline.rb → smelly_source/inline.rb} +0 -0
- data/samples/{optparse.rb → smelly_source/optparse.rb} +0 -0
- data/samples/{redcloth.rb → smelly_source/redcloth.rb} +0 -0
- data/samples/{smelly.rb → smelly_source/smelly.rb} +0 -0
- data/samples/source_with_hidden_directories/.hidden/hidden.rb +1 -0
- data/samples/source_with_hidden_directories/not_hidden.rb +1 -0
- data/samples/{source_with_hidden_directories/uncommunicative_parameter_name.rb → source_with_non_ruby_files/ruby.rb} +0 -0
- data/spec/reek/ast/node_spec.rb +5 -5
- data/spec/reek/cli/application_spec.rb +18 -4
- data/spec/reek/cli/command/todo_list_command_spec.rb +4 -2
- data/spec/reek/cli/silencer_spec.rb +28 -0
- data/spec/reek/code_comment_spec.rb +0 -7
- data/spec/reek/configuration/app_configuration_spec.rb +44 -31
- data/spec/reek/configuration/configuration_file_finder_spec.rb +133 -49
- data/spec/reek/configuration/default_directive_spec.rb +1 -1
- data/spec/reek/configuration/directory_directives_spec.rb +3 -4
- data/spec/reek/configuration/excluded_paths_spec.rb +5 -5
- data/spec/reek/configuration/rake_task_converter_spec.rb +33 -0
- data/spec/reek/configuration/schema_validator_spec.rb +165 -0
- data/spec/reek/context/code_context_spec.rb +1 -1
- data/spec/reek/examiner_spec.rb +28 -1
- data/spec/reek/report/json_report_spec.rb +13 -46
- data/spec/reek/report/{formatter/location_formatter_spec.rb → location_formatter_spec.rb} +5 -5
- data/spec/reek/report/{formatter/progress_formatter_spec.rb → progress_formatter_spec.rb} +4 -4
- data/spec/reek/report/text_report_spec.rb +4 -4
- data/spec/reek/report/xml_report_spec.rb +1 -1
- data/spec/reek/report/yaml_report_spec.rb +9 -38
- data/spec/reek/report_spec.rb +3 -3
- data/spec/reek/smell_detectors/feature_envy_spec.rb +2 -2
- data/spec/reek/smell_detectors/{prima_donna_method_spec.rb → missing_safe_method_spec.rb} +9 -9
- data/spec/reek/smell_detectors/too_many_constants_spec.rb +3 -3
- data/spec/reek/smell_detectors/too_many_instance_variables_spec.rb +1 -1
- data/spec/reek/smell_detectors/uncommunicative_method_name_spec.rb +6 -6
- data/spec/reek/smell_detectors/uncommunicative_module_name_spec.rb +6 -4
- data/spec/reek/smell_detectors/uncommunicative_parameter_name_spec.rb +6 -4
- data/spec/reek/smell_detectors/uncommunicative_variable_name_spec.rb +6 -6
- data/spec/reek/smell_detectors/unused_private_method_spec.rb +1 -1
- data/spec/reek/smell_warning_spec.rb +4 -0
- data/spec/reek/source/source_code_spec.rb +16 -22
- data/spec/reek/source/source_locator_spec.rb +11 -11
- data/spec/reek/spec/should_reek_of_spec.rb +0 -4
- data/spec/reek/spec/should_reek_only_of_spec.rb +2 -2
- data/spec/reek/spec/should_reek_spec.rb +1 -1
- data/spec/reek/tree_dresser_spec.rb +2 -6
- data/spec/spec_helper.rb +3 -5
- data/tasks/configuration.rake +8 -5
- metadata +56 -35
- data/defaults.reek +0 -131
- data/features/configuration_files/warn_about_multiple_configuration_files.feature +0 -44
- data/lib/reek/report/formatter.rb +0 -33
- data/lib/reek/report/formatter/heading_formatter.rb +0 -52
- data/lib/reek/report/formatter/location_formatter.rb +0 -42
- data/lib/reek/report/formatter/progress_formatter.rb +0 -81
- data/lib/reek/report/formatter/simple_warning_formatter.rb +0 -35
- data/lib/reek/report/formatter/wiki_link_warning_formatter.rb +0 -23
- data/lib/reek/smell_detectors/syntax.rb +0 -37
- data/samples/configuration/non_public_modifiers_mask.reek +0 -3
- data/samples/smelly_with_inline_mask.rb +0 -8
- data/samples/smelly_with_modifiers.rb +0 -12
- data/samples/source_with_hidden_directories/.hidden/uncommunicative_method_name.rb +0 -5
- data/samples/source_with_non_ruby_files/uncommunicative_parameter_name.rb +0 -6
- data/spec/reek/smell_detectors/syntax_spec.rb +0 -17
@@ -11,10 +11,6 @@ RSpec.describe Reek::Spec::ShouldReekOf do
|
|
11
11
|
expect(ruby).to reek_of(:DuplicateMethodCall)
|
12
12
|
end
|
13
13
|
|
14
|
-
it 'reports duplicate calls by smell detector class' do
|
15
|
-
expect(ruby).to reek_of(Reek::SmellDetectors::DuplicateMethodCall)
|
16
|
-
end
|
17
|
-
|
18
14
|
it 'does not report any feature envy' do
|
19
15
|
expect(ruby).not_to reek_of(:FeatureEnvy)
|
20
16
|
end
|
@@ -21,7 +21,7 @@ RSpec.describe Reek::Spec::ShouldReekOnlyOf do
|
|
21
21
|
context 'when a match was expected' do
|
22
22
|
let(:source) { 'the_path/to_a/source_file.rb' }
|
23
23
|
|
24
|
-
before { allow(examiner).to receive(:
|
24
|
+
before { allow(examiner).to receive(:origin).and_return(source) }
|
25
25
|
|
26
26
|
it 'reports the source' do
|
27
27
|
expect(matcher.failure_message).to match(source)
|
@@ -91,7 +91,7 @@ RSpec.describe Reek::Spec::ShouldReekOnlyOf do
|
|
91
91
|
|
92
92
|
it 'reports the source when no match was expected' do
|
93
93
|
source = 'the_path/to_a/source_file.rb'
|
94
|
-
allow(examiner).to receive(:
|
94
|
+
allow(examiner).to receive(:origin).and_return(source)
|
95
95
|
expect(matcher.failure_message_when_negated).to match(source)
|
96
96
|
end
|
97
97
|
end
|
@@ -40,7 +40,7 @@ RSpec.describe Reek::Spec::ShouldReek do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
context 'with masking' do
|
43
|
-
let(:path) {
|
43
|
+
let(:path) { CONFIGURATION_DIR.join('full_mask.reek') }
|
44
44
|
let(:configuration) { test_configuration_for(path) }
|
45
45
|
let(:matcher) { described_class.new(configuration: configuration) }
|
46
46
|
|
@@ -1,16 +1,12 @@
|
|
1
|
-
require_lib 'reek/cli/silencer'
|
2
|
-
Reek::CLI::Silencer.silently do
|
3
|
-
require 'parser/ruby22'
|
4
|
-
end
|
5
|
-
|
6
1
|
require_relative '../spec_helper'
|
2
|
+
Reek::CLI::Silencer.without_warnings { require 'parser/ruby25' }
|
7
3
|
require_lib 'reek/tree_dresser'
|
8
4
|
|
9
5
|
RSpec.describe Reek::TreeDresser do
|
10
6
|
describe '#dress' do
|
11
7
|
let(:dresser) { described_class.new }
|
12
8
|
let(:sexp) do
|
13
|
-
Parser::
|
9
|
+
Parser::Ruby25.parse('class Klazz; def meth(argument); argument.call_me; end; end')
|
14
10
|
end
|
15
11
|
let(:dressed_ast) { dresser.dress(sexp, {}) }
|
16
12
|
|
data/spec/spec_helper.rb
CHANGED
@@ -8,11 +8,9 @@ require_relative '../lib/reek/configuration/app_configuration'
|
|
8
8
|
|
9
9
|
require_relative '../samples/paths'
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
15
|
-
end
|
11
|
+
begin
|
12
|
+
Reek::CLI::Silencer.without_warnings { require 'pry-byebug' }
|
13
|
+
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
16
14
|
end
|
17
15
|
|
18
16
|
require 'factory_bot'
|
data/tasks/configuration.rake
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
require_relative '../lib/reek/detector_repository'
|
2
|
+
require_relative '../lib/reek/configuration/rake_task_converter'
|
3
|
+
require_relative '../lib/reek/configuration/app_configuration'
|
4
|
+
|
2
5
|
require 'yaml'
|
3
6
|
|
4
7
|
namespace :configuration do
|
5
8
|
desc 'Updates the default configuration file when smell defaults change'
|
6
9
|
task :update_default_configuration do
|
7
|
-
DEFAULT_SMELL_CONFIGURATION = 'defaults.reek'.freeze
|
10
|
+
DEFAULT_SMELL_CONFIGURATION = 'docs/defaults.reek.yml'.freeze
|
8
11
|
content = Reek::DetectorRepository.smell_types.each_with_object({}) do |klass, hash|
|
9
|
-
hash[klass.smell_type] = klass.default_config
|
12
|
+
hash[klass.smell_type] = Reek::Configuration::RakeTaskConverter.convert klass.default_config
|
13
|
+
end
|
14
|
+
File.open(DEFAULT_SMELL_CONFIGURATION, 'w') do |file|
|
15
|
+
YAML.dump({ Reek::Configuration::AppConfiguration::DETECTORS_KEY => content }, file)
|
10
16
|
end
|
11
|
-
File.open(DEFAULT_SMELL_CONFIGURATION, 'w') { |file| YAML.dump(content, file) }
|
12
17
|
end
|
13
18
|
end
|
14
|
-
|
15
|
-
task 'test:spec' => 'configuration:update_default_configuration'
|
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:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Rutherford
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-06-
|
14
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: codeclimate-engine-rb
|
@@ -27,6 +27,20 @@ dependencies:
|
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.4.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: kwalify
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - "~>"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.7.0
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.7.0
|
30
44
|
- !ruby/object:Gem::Dependency
|
31
45
|
name: parser
|
32
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,6 +96,7 @@ files:
|
|
82
96
|
- ".codeclimate.yml"
|
83
97
|
- ".dockerignore"
|
84
98
|
- ".gitignore"
|
99
|
+
- ".reek.yml"
|
85
100
|
- ".rubocop.yml"
|
86
101
|
- ".simplecov"
|
87
102
|
- ".travis.yml"
|
@@ -96,7 +111,6 @@ files:
|
|
96
111
|
- ataru_setup.rb
|
97
112
|
- bin/code_climate_reek
|
98
113
|
- bin/reek
|
99
|
-
- defaults.reek
|
100
114
|
- docs/API.md
|
101
115
|
- docs/Attribute.md
|
102
116
|
- docs/Basic-Smell-Options.md
|
@@ -117,12 +131,13 @@ files:
|
|
117
131
|
- docs/Long-Parameter-List.md
|
118
132
|
- docs/Long-Yield-List.md
|
119
133
|
- docs/Manual-Dispatch.md
|
134
|
+
- docs/Missing-Safe-Method.md
|
120
135
|
- docs/Module-Initialize.md
|
121
136
|
- docs/Nested-Iterators.md
|
122
137
|
- docs/Nil-Check.md
|
123
|
-
- docs/Prima-Donna-Method.md
|
124
138
|
- docs/RSpec-matchers.md
|
125
139
|
- docs/Rake-Task.md
|
140
|
+
- docs/Reek-4-to-Reek-5-migration.md
|
126
141
|
- docs/Reek-Driven-Development.md
|
127
142
|
- docs/Repeated-Conditional.md
|
128
143
|
- docs/Simulated-Polymorphism.md
|
@@ -143,6 +158,7 @@ files:
|
|
143
158
|
- docs/Utility-Function.md
|
144
159
|
- docs/Versioning-Policy.md
|
145
160
|
- docs/YAML-Reports.md
|
161
|
+
- docs/defaults.reek.yml
|
146
162
|
- docs/templates/default/docstring/html/public_api_marker.erb
|
147
163
|
- docs/templates/default/docstring/setup.rb
|
148
164
|
- docs/templates/default/fulldoc/html/css/common.css
|
@@ -161,8 +177,8 @@ files:
|
|
161
177
|
- features/configuration_files/masking_smells.feature
|
162
178
|
- features/configuration_files/mix_accept_reject_setting.feature
|
163
179
|
- features/configuration_files/reject_setting.feature
|
180
|
+
- features/configuration_files/schema_validation.feature
|
164
181
|
- features/configuration_files/unused_private_method.feature
|
165
|
-
- features/configuration_files/warn_about_multiple_configuration_files.feature
|
166
182
|
- features/configuration_loading.feature
|
167
183
|
- features/configuration_via_source_comments/erroneous_source_comments.feature
|
168
184
|
- features/configuration_via_source_comments/well_formed_source_comments.feature
|
@@ -216,11 +232,15 @@ files:
|
|
216
232
|
- lib/reek/cli/status.rb
|
217
233
|
- lib/reek/code_comment.rb
|
218
234
|
- lib/reek/configuration/app_configuration.rb
|
235
|
+
- lib/reek/configuration/configuration_converter.rb
|
219
236
|
- lib/reek/configuration/configuration_file_finder.rb
|
220
237
|
- lib/reek/configuration/configuration_validator.rb
|
221
238
|
- lib/reek/configuration/default_directive.rb
|
222
239
|
- lib/reek/configuration/directory_directives.rb
|
223
240
|
- lib/reek/configuration/excluded_paths.rb
|
241
|
+
- lib/reek/configuration/rake_task_converter.rb
|
242
|
+
- lib/reek/configuration/schema.yml
|
243
|
+
- lib/reek/configuration/schema_validator.rb
|
224
244
|
- lib/reek/context/attribute_context.rb
|
225
245
|
- lib/reek/context/class_context.rb
|
226
246
|
- lib/reek/context/code_context.rb
|
@@ -239,9 +259,11 @@ files:
|
|
239
259
|
- lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb
|
240
260
|
- lib/reek/errors/bad_detector_in_comment_error.rb
|
241
261
|
- lib/reek/errors/base_error.rb
|
262
|
+
- lib/reek/errors/config_file_error.rb
|
242
263
|
- lib/reek/errors/encoding_error.rb
|
243
264
|
- lib/reek/errors/garbage_detector_configuration_in_comment_error.rb
|
244
265
|
- lib/reek/errors/incomprehensible_source_error.rb
|
266
|
+
- lib/reek/errors/syntax_error.rb
|
245
267
|
- lib/reek/examiner.rb
|
246
268
|
- lib/reek/logging_error_handler.rb
|
247
269
|
- lib/reek/rake/task.rb
|
@@ -253,15 +275,14 @@ files:
|
|
253
275
|
- lib/reek/report/code_climate/code_climate_fingerprint.rb
|
254
276
|
- lib/reek/report/code_climate/code_climate_formatter.rb
|
255
277
|
- lib/reek/report/code_climate/code_climate_report.rb
|
256
|
-
- lib/reek/report/
|
257
|
-
- lib/reek/report/
|
258
|
-
- lib/reek/report/formatter/location_formatter.rb
|
259
|
-
- lib/reek/report/formatter/progress_formatter.rb
|
260
|
-
- lib/reek/report/formatter/simple_warning_formatter.rb
|
261
|
-
- lib/reek/report/formatter/wiki_link_warning_formatter.rb
|
278
|
+
- lib/reek/report/documentation_link_warning_formatter.rb
|
279
|
+
- lib/reek/report/heading_formatter.rb
|
262
280
|
- lib/reek/report/html_report.rb
|
263
281
|
- lib/reek/report/html_report/html_report.html.erb
|
264
282
|
- lib/reek/report/json_report.rb
|
283
|
+
- lib/reek/report/location_formatter.rb
|
284
|
+
- lib/reek/report/progress_formatter.rb
|
285
|
+
- lib/reek/report/simple_warning_formatter.rb
|
265
286
|
- lib/reek/report/text_report.rb
|
266
287
|
- lib/reek/report/xml_report.rb
|
267
288
|
- lib/reek/report/yaml_report.rb
|
@@ -280,13 +301,12 @@ files:
|
|
280
301
|
- lib/reek/smell_detectors/long_parameter_list.rb
|
281
302
|
- lib/reek/smell_detectors/long_yield_list.rb
|
282
303
|
- lib/reek/smell_detectors/manual_dispatch.rb
|
304
|
+
- lib/reek/smell_detectors/missing_safe_method.rb
|
283
305
|
- lib/reek/smell_detectors/module_initialize.rb
|
284
306
|
- lib/reek/smell_detectors/nested_iterators.rb
|
285
307
|
- lib/reek/smell_detectors/nil_check.rb
|
286
|
-
- lib/reek/smell_detectors/prima_donna_method.rb
|
287
308
|
- lib/reek/smell_detectors/repeated_conditional.rb
|
288
309
|
- lib/reek/smell_detectors/subclassed_from_core_class.rb
|
289
|
-
- lib/reek/smell_detectors/syntax.rb
|
290
310
|
- lib/reek/smell_detectors/too_many_constants.rb
|
291
311
|
- lib/reek/smell_detectors/too_many_instance_variables.rb
|
292
312
|
- lib/reek/smell_detectors/too_many_methods.rb
|
@@ -316,33 +336,32 @@ files:
|
|
316
336
|
- logo/reek.text.svg
|
317
337
|
- reek.gemspec
|
318
338
|
- samples/checkstyle.xml
|
319
|
-
- samples/clean.rb
|
339
|
+
- samples/clean_source/clean.rb
|
340
|
+
- samples/configuration/accepts_rejects_and_excludes_for_detectors.reek.yml
|
341
|
+
- samples/configuration/accepts_rejects_and_excludes_for_directory_directives.reek.yml
|
320
342
|
- samples/configuration/corrupt.reek
|
321
343
|
- samples/configuration/empty.reek
|
322
344
|
- samples/configuration/full_configuration.reek
|
323
345
|
- samples/configuration/full_mask.reek
|
324
|
-
- samples/configuration/
|
325
|
-
- samples/configuration/more_than_one_configuration_file/todo.reek
|
326
|
-
- samples/configuration/non_public_modifiers_mask.reek
|
346
|
+
- samples/configuration/home/home.reek.yml
|
327
347
|
- samples/configuration/partial_mask.reek
|
328
|
-
- samples/configuration/
|
348
|
+
- samples/configuration/regular_configuration/.reek.yml
|
349
|
+
- samples/configuration/regular_configuration/empty_sub_directory/.gitignore
|
329
350
|
- samples/configuration/with_excluded_paths.reek
|
330
|
-
- samples/
|
331
|
-
- samples/inline.rb
|
332
|
-
- samples/optparse.rb
|
351
|
+
- samples/no_config_file/.keep
|
333
352
|
- samples/paths.rb
|
334
|
-
- samples/
|
335
|
-
- samples/
|
336
|
-
- samples/
|
337
|
-
- samples/
|
353
|
+
- samples/smelly_source/inline.rb
|
354
|
+
- samples/smelly_source/optparse.rb
|
355
|
+
- samples/smelly_source/redcloth.rb
|
356
|
+
- samples/smelly_source/smelly.rb
|
338
357
|
- samples/source_with_exclude_paths/ignore_me/uncommunicative_method_name.rb
|
339
358
|
- samples/source_with_exclude_paths/nested/ignore_me_as_well/irresponsible_module.rb
|
340
359
|
- samples/source_with_exclude_paths/nested/uncommunicative_parameter_name.rb
|
341
|
-
- samples/source_with_hidden_directories/.hidden/
|
342
|
-
- samples/source_with_hidden_directories/
|
360
|
+
- samples/source_with_hidden_directories/.hidden/hidden.rb
|
361
|
+
- samples/source_with_hidden_directories/not_hidden.rb
|
343
362
|
- samples/source_with_non_ruby_files/gibberish
|
344
363
|
- samples/source_with_non_ruby_files/python_source.py
|
345
|
-
- samples/source_with_non_ruby_files/
|
364
|
+
- samples/source_with_non_ruby_files/ruby.rb
|
346
365
|
- spec/factories/factories.rb
|
347
366
|
- spec/quality/reek_source_spec.rb
|
348
367
|
- spec/reek/ast/node_spec.rb
|
@@ -353,12 +372,15 @@ files:
|
|
353
372
|
- spec/reek/cli/command/report_command_spec.rb
|
354
373
|
- spec/reek/cli/command/todo_list_command_spec.rb
|
355
374
|
- spec/reek/cli/options_spec.rb
|
375
|
+
- spec/reek/cli/silencer_spec.rb
|
356
376
|
- spec/reek/code_comment_spec.rb
|
357
377
|
- spec/reek/configuration/app_configuration_spec.rb
|
358
378
|
- spec/reek/configuration/configuration_file_finder_spec.rb
|
359
379
|
- spec/reek/configuration/default_directive_spec.rb
|
360
380
|
- spec/reek/configuration/directory_directives_spec.rb
|
361
381
|
- spec/reek/configuration/excluded_paths_spec.rb
|
382
|
+
- spec/reek/configuration/rake_task_converter_spec.rb
|
383
|
+
- spec/reek/configuration/schema_validator_spec.rb
|
362
384
|
- spec/reek/context/code_context_spec.rb
|
363
385
|
- spec/reek/context/ghost_context_spec.rb
|
364
386
|
- spec/reek/context/method_context_spec.rb
|
@@ -376,10 +398,10 @@ files:
|
|
376
398
|
- spec/reek/report/code_climate/code_climate_fingerprint_spec.rb
|
377
399
|
- spec/reek/report/code_climate/code_climate_formatter_spec.rb
|
378
400
|
- spec/reek/report/code_climate/code_climate_report_spec.rb
|
379
|
-
- spec/reek/report/formatter/location_formatter_spec.rb
|
380
|
-
- spec/reek/report/formatter/progress_formatter_spec.rb
|
381
401
|
- spec/reek/report/html_report_spec.rb
|
382
402
|
- spec/reek/report/json_report_spec.rb
|
403
|
+
- spec/reek/report/location_formatter_spec.rb
|
404
|
+
- spec/reek/report/progress_formatter_spec.rb
|
383
405
|
- spec/reek/report/text_report_spec.rb
|
384
406
|
- spec/reek/report/xml_report_spec.rb
|
385
407
|
- spec/reek/report/yaml_report_spec.rb
|
@@ -398,13 +420,12 @@ files:
|
|
398
420
|
- spec/reek/smell_detectors/long_parameter_list_spec.rb
|
399
421
|
- spec/reek/smell_detectors/long_yield_list_spec.rb
|
400
422
|
- spec/reek/smell_detectors/manual_dispatch_spec.rb
|
423
|
+
- spec/reek/smell_detectors/missing_safe_method_spec.rb
|
401
424
|
- spec/reek/smell_detectors/module_initialize_spec.rb
|
402
425
|
- spec/reek/smell_detectors/nested_iterators_spec.rb
|
403
426
|
- spec/reek/smell_detectors/nil_check_spec.rb
|
404
|
-
- spec/reek/smell_detectors/prima_donna_method_spec.rb
|
405
427
|
- spec/reek/smell_detectors/repeated_conditional_spec.rb
|
406
428
|
- spec/reek/smell_detectors/subclassed_from_core_class_spec.rb
|
407
|
-
- spec/reek/smell_detectors/syntax_spec.rb
|
408
429
|
- spec/reek/smell_detectors/too_many_constants_spec.rb
|
409
430
|
- spec/reek/smell_detectors/too_many_instance_variables_spec.rb
|
410
431
|
- spec/reek/smell_detectors/too_many_methods_spec.rb
|
@@ -431,7 +452,7 @@ files:
|
|
431
452
|
- tasks/reek.rake
|
432
453
|
- tasks/rubocop.rake
|
433
454
|
- tasks/test.rake
|
434
|
-
homepage: https://github.com/troessner/reek
|
455
|
+
homepage: https://github.com/troessner/reek
|
435
456
|
licenses:
|
436
457
|
- MIT
|
437
458
|
metadata: {}
|
@@ -447,7 +468,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
447
468
|
requirements:
|
448
469
|
- - ">="
|
449
470
|
- !ruby/object:Gem::Version
|
450
|
-
version: 2.
|
471
|
+
version: 2.3.0
|
451
472
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
452
473
|
requirements:
|
453
474
|
- - ">="
|
@@ -455,7 +476,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
455
476
|
version: '0'
|
456
477
|
requirements: []
|
457
478
|
rubyforge_project:
|
458
|
-
rubygems_version: 2.
|
479
|
+
rubygems_version: 2.5.2.2
|
459
480
|
signing_key:
|
460
481
|
specification_version: 4
|
461
482
|
summary: Code smell detector for Ruby
|
data/defaults.reek
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: true
|
4
|
-
exclude: []
|
5
|
-
BooleanParameter:
|
6
|
-
enabled: true
|
7
|
-
exclude: []
|
8
|
-
ClassVariable:
|
9
|
-
enabled: true
|
10
|
-
exclude: []
|
11
|
-
ControlParameter:
|
12
|
-
enabled: true
|
13
|
-
exclude: []
|
14
|
-
DataClump:
|
15
|
-
enabled: true
|
16
|
-
exclude: []
|
17
|
-
max_copies: 2
|
18
|
-
min_clump_size: 2
|
19
|
-
DuplicateMethodCall:
|
20
|
-
enabled: true
|
21
|
-
exclude: []
|
22
|
-
max_calls: 1
|
23
|
-
allow_calls: []
|
24
|
-
FeatureEnvy:
|
25
|
-
enabled: true
|
26
|
-
exclude: []
|
27
|
-
InstanceVariableAssumption:
|
28
|
-
enabled: true
|
29
|
-
exclude: []
|
30
|
-
IrresponsibleModule:
|
31
|
-
enabled: true
|
32
|
-
exclude: []
|
33
|
-
LongParameterList:
|
34
|
-
enabled: true
|
35
|
-
exclude: []
|
36
|
-
max_params: 3
|
37
|
-
overrides:
|
38
|
-
initialize:
|
39
|
-
max_params: 5
|
40
|
-
LongYieldList:
|
41
|
-
enabled: true
|
42
|
-
exclude: []
|
43
|
-
max_params: 3
|
44
|
-
ManualDispatch:
|
45
|
-
enabled: true
|
46
|
-
exclude: []
|
47
|
-
ModuleInitialize:
|
48
|
-
enabled: true
|
49
|
-
exclude: []
|
50
|
-
NestedIterators:
|
51
|
-
enabled: true
|
52
|
-
exclude: []
|
53
|
-
max_allowed_nesting: 1
|
54
|
-
ignore_iterators:
|
55
|
-
- tap
|
56
|
-
NilCheck:
|
57
|
-
enabled: true
|
58
|
-
exclude: []
|
59
|
-
PrimaDonnaMethod:
|
60
|
-
enabled: true
|
61
|
-
exclude: []
|
62
|
-
RepeatedConditional:
|
63
|
-
enabled: true
|
64
|
-
exclude: []
|
65
|
-
max_ifs: 2
|
66
|
-
SubclassedFromCoreClass:
|
67
|
-
enabled: true
|
68
|
-
exclude: []
|
69
|
-
Syntax:
|
70
|
-
enabled: true
|
71
|
-
exclude: []
|
72
|
-
TooManyConstants:
|
73
|
-
enabled: true
|
74
|
-
exclude: []
|
75
|
-
max_constants: 5
|
76
|
-
TooManyInstanceVariables:
|
77
|
-
enabled: true
|
78
|
-
exclude: []
|
79
|
-
max_instance_variables: 4
|
80
|
-
TooManyMethods:
|
81
|
-
enabled: true
|
82
|
-
exclude: []
|
83
|
-
max_methods: 15
|
84
|
-
TooManyStatements:
|
85
|
-
enabled: true
|
86
|
-
exclude:
|
87
|
-
- initialize
|
88
|
-
max_statements: 5
|
89
|
-
UncommunicativeMethodName:
|
90
|
-
enabled: true
|
91
|
-
exclude: []
|
92
|
-
reject:
|
93
|
-
- !ruby/regexp /^[a-z]$/
|
94
|
-
- !ruby/regexp /[0-9]$/
|
95
|
-
- !ruby/regexp /[A-Z]/
|
96
|
-
accept: []
|
97
|
-
UncommunicativeModuleName:
|
98
|
-
enabled: true
|
99
|
-
exclude: []
|
100
|
-
reject:
|
101
|
-
- !ruby/regexp /^.$/
|
102
|
-
- !ruby/regexp /[0-9]$/
|
103
|
-
accept: []
|
104
|
-
UncommunicativeParameterName:
|
105
|
-
enabled: true
|
106
|
-
exclude: []
|
107
|
-
reject:
|
108
|
-
- !ruby/regexp /^.$/
|
109
|
-
- !ruby/regexp /[0-9]$/
|
110
|
-
- !ruby/regexp /[A-Z]/
|
111
|
-
- !ruby/regexp /^_/
|
112
|
-
accept: []
|
113
|
-
UncommunicativeVariableName:
|
114
|
-
enabled: true
|
115
|
-
exclude: []
|
116
|
-
reject:
|
117
|
-
- !ruby/regexp /^.$/
|
118
|
-
- !ruby/regexp /[0-9]$/
|
119
|
-
- !ruby/regexp /[A-Z]/
|
120
|
-
accept:
|
121
|
-
- !ruby/regexp /^_$/
|
122
|
-
UnusedParameters:
|
123
|
-
enabled: true
|
124
|
-
exclude: []
|
125
|
-
UnusedPrivateMethod:
|
126
|
-
enabled: false
|
127
|
-
exclude: []
|
128
|
-
UtilityFunction:
|
129
|
-
enabled: true
|
130
|
-
exclude: []
|
131
|
-
public_methods_only: false
|