reek 4.8.1 → 5.6.0
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/.rubocop.yml +22 -68
- data/.rubocop_todo.yml +63 -0
- data/.simplecov +8 -2
- data/.travis.yml +8 -8
- data/.yardopts +1 -1
- data/CHANGELOG.md +84 -0
- data/CONTRIBUTING.md +25 -0
- data/Dockerfile +1 -1
- data/Gemfile +14 -18
- data/README.md +152 -135
- data/Rakefile +16 -3
- data/bin/reek +1 -3
- data/docs/API.md +6 -13
- 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 +117 -2
- data/docs/Feature-Envy.md +44 -0
- data/docs/How-To-Write-New-Detectors.md +6 -7
- data/docs/Instance-Variable-Assumption.md +30 -1
- 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 +188 -0
- data/docs/Reek-Driven-Development.md +19 -12
- data/docs/Uncommunicative-Method-Name.md +45 -6
- data/docs/Uncommunicative-Module-Name.md +49 -7
- data/docs/Uncommunicative-Parameter-Name.md +43 -5
- 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/templates/default/docstring/setup.rb +3 -0
- data/docs/yard_plugin.rb +1 -0
- data/features/command_line_interface/basic_usage.feature +2 -2
- data/features/command_line_interface/options.feature +49 -5
- data/features/command_line_interface/show_progress.feature +4 -4
- data/features/command_line_interface/smell_selection.feature +1 -1
- data/features/command_line_interface/smells_count.feature +6 -6
- data/features/command_line_interface/stdin.feature +30 -8
- data/features/configuration_files/accept_setting.feature +45 -28
- data/features/configuration_files/directory_specific_directives.feature +78 -73
- data/features/configuration_files/exclude_directives.feature +11 -10
- data/features/configuration_files/exclude_paths_directives.feature +12 -13
- data/features/configuration_files/masking_smells.feature +38 -9
- data/features/configuration_files/mix_accept_reject_setting.feature +31 -28
- data/features/configuration_files/reject_setting.feature +52 -41
- data/features/configuration_files/schema_validation.feature +59 -0
- data/features/configuration_files/show_configuration_file.feature +44 -0
- data/features/configuration_files/unused_private_method.feature +18 -16
- data/features/configuration_loading.feature +53 -10
- data/features/configuration_via_source_comments/erroneous_source_comments.feature +2 -2
- data/features/configuration_via_source_comments/well_formed_source_comments.feature +2 -2
- data/features/locales.feature +2 -2
- data/features/rake_task/rake_task.feature +16 -16
- data/features/reports/json.feature +3 -3
- data/features/reports/reports.feature +34 -34
- data/features/reports/yaml.feature +3 -3
- data/features/rspec_matcher.feature +10 -1
- data/features/samples.feature +287 -287
- data/features/step_definitions/reek_steps.rb +4 -0
- data/features/step_definitions/sample_file_steps.rb +20 -11
- data/features/support/env.rb +3 -3
- data/features/todo_list.feature +60 -44
- data/lib/reek/ast/node.rb +7 -6
- data/lib/reek/ast/object_refs.rb +1 -1
- data/lib/reek/ast/sexp_extensions/case.rb +3 -1
- data/lib/reek/ast/sexp_extensions/if.rb +22 -2
- data/lib/reek/ast/sexp_extensions/logical_operators.rb +1 -1
- data/lib/reek/ast/sexp_extensions/methods.rb +2 -1
- data/lib/reek/ast/sexp_extensions/yield.rb +0 -4
- data/lib/reek/ast/sexp_extensions.rb +0 -2
- data/lib/reek/cli/application.rb +29 -3
- data/lib/reek/cli/command/report_command.rb +1 -2
- data/lib/reek/cli/command/todo_list_command.rb +25 -8
- data/lib/reek/cli/options.rb +49 -27
- data/lib/reek/cli/silencer.rb +14 -3
- data/lib/reek/code_comment.rb +33 -33
- data/lib/reek/configuration/app_configuration.rb +29 -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 +46 -12
- data/lib/reek/configuration/excluded_paths.rb +4 -4
- 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 +39 -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 +3 -2
- data/lib/reek/context/module_context.rb +6 -5
- data/lib/reek/context/visibility_tracker.rb +7 -4
- data/lib/reek/context_builder.rb +10 -9
- data/lib/reek/detector_repository.rb +7 -0
- data/lib/reek/documentation_link.rb +28 -0
- data/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb +4 -3
- data/lib/reek/errors/bad_detector_in_comment_error.rb +4 -3
- 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 +4 -3
- data/lib/reek/errors/incomprehensible_source_error.rb +4 -4
- data/lib/reek/errors/syntax_error.rb +45 -0
- data/lib/reek/examiner.rb +14 -23
- data/lib/reek/logging_error_handler.rb +1 -1
- data/lib/reek/rake/task.rb +3 -3
- data/lib/reek/report/base_report.rb +8 -12
- data/lib/reek/report/code_climate/code_climate_configuration.yml +6 -10
- 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 +4 -4
- data/lib/reek/report/xml_report.rb +3 -3
- data/lib/reek/report/yaml_report.rb +1 -1
- data/lib/reek/report.rb +20 -15
- data/lib/reek/smell_configuration.rb +2 -2
- data/lib/reek/smell_detectors/attribute.rb +0 -1
- data/lib/reek/smell_detectors/base_detector.rb +10 -13
- 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 +19 -128
- data/lib/reek/smell_detectors/control_parameter_helpers/call_in_condition_finder.rb +91 -0
- data/lib/reek/smell_detectors/control_parameter_helpers/candidate.rb +38 -0
- data/lib/reek/smell_detectors/control_parameter_helpers/control_parameter_finder.rb +94 -0
- data/lib/reek/smell_detectors/data_clump.rb +4 -5
- data/lib/reek/smell_detectors/duplicate_method_call.rb +6 -6
- data/lib/reek/smell_detectors/feature_envy.rb +3 -1
- data/lib/reek/smell_detectors/instance_variable_assumption.rb +0 -1
- data/lib/reek/smell_detectors/irresponsible_module.rb +1 -1
- data/lib/reek/smell_detectors/long_parameter_list.rb +2 -2
- data/lib/reek/smell_detectors/long_yield_list.rb +2 -3
- data/lib/reek/smell_detectors/manual_dispatch.rb +3 -2
- data/lib/reek/smell_detectors/{prima_donna_method.rb → missing_safe_method.rb} +7 -7
- data/lib/reek/smell_detectors/module_initialize.rb +0 -1
- data/lib/reek/smell_detectors/nested_iterators.rb +5 -5
- data/lib/reek/smell_detectors/nil_check.rb +0 -1
- data/lib/reek/smell_detectors/repeated_conditional.rb +4 -4
- data/lib/reek/smell_detectors/subclassed_from_core_class.rb +3 -8
- data/lib/reek/smell_detectors/too_many_constants.rb +2 -3
- data/lib/reek/smell_detectors/too_many_instance_variables.rb +2 -2
- data/lib/reek/smell_detectors/too_many_methods.rb +2 -2
- data/lib/reek/smell_detectors/too_many_statements.rb +2 -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 +6 -5
- data/lib/reek/smell_detectors/unused_parameters.rb +1 -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_detectors.rb +1 -2
- data/lib/reek/smell_warning.rb +31 -20
- data/lib/reek/source/source_code.rb +42 -56
- data/lib/reek/source/source_locator.rb +10 -7
- 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 +5 -4
- data/lib/reek/spec/smell_matcher.rb +1 -0
- data/lib/reek/spec.rb +8 -14
- data/lib/reek/tree_dresser.rb +6 -5
- data/lib/reek/version.rb +1 -1
- data/lib/reek.rb +7 -0
- data/reek.gemspec +5 -4
- data/samples/checkstyle.xml +1 -1
- 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/configuration/partial_mask.reek +3 -2
- data/samples/configuration/regular_configuration/.reek.yml +4 -0
- data/samples/configuration/with_excluded_paths.reek +1 -0
- data/samples/paths.rb +5 -4
- data/samples/smelly_source/ruby.rb +368 -0
- data/samples/{source_with_hidden_directories/.hidden/uncommunicative_method_name.rb → source_with_exclude_paths/nested/uncommunicative_variable_name.rb} +2 -1
- data/samples/source_with_hidden_directories/.hidden/hidden.rb +1 -0
- data/samples/source_with_hidden_directories/not_hidden.rb +1 -0
- data/spec/factories/factories.rb +12 -22
- data/spec/performance/reek/smell_detectors/runtime_speed_spec.rb +17 -0
- data/spec/quality/documentation_spec.rb +40 -0
- data/spec/reek/ast/node_spec.rb +7 -7
- data/spec/reek/ast/sexp_extensions_spec.rb +20 -20
- data/spec/reek/cli/application_spec.rb +48 -5
- data/spec/reek/cli/command/todo_list_command_spec.rb +65 -45
- data/spec/reek/cli/silencer_spec.rb +28 -0
- data/spec/reek/code_comment_spec.rb +6 -13
- data/spec/reek/configuration/app_configuration_spec.rb +106 -45
- data/spec/reek/configuration/configuration_file_finder_spec.rb +143 -49
- data/spec/reek/configuration/default_directive_spec.rb +1 -1
- data/spec/reek/configuration/directory_directives_spec.rb +45 -7
- data/spec/reek/configuration/excluded_paths_spec.rb +6 -9
- 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 +3 -3
- data/spec/reek/context_builder_spec.rb +30 -30
- data/spec/reek/detector_repository_spec.rb +2 -2
- data/spec/reek/documentation_link_spec.rb +20 -0
- data/spec/reek/examiner_spec.rb +39 -11
- data/spec/reek/report/code_climate/code_climate_fingerprint_spec.rb +22 -22
- data/spec/reek/report/code_climate/code_climate_formatter_spec.rb +5 -5
- data/spec/reek/report/code_climate/code_climate_report_spec.rb +21 -21
- data/spec/reek/report/json_report_spec.rb +16 -49
- 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 +3 -9
- data/spec/reek/report/xml_report_spec.rb +1 -1
- data/spec/reek/report/yaml_report_spec.rb +12 -41
- data/spec/reek/report_spec.rb +3 -3
- data/spec/reek/smell_configuration_spec.rb +2 -0
- data/spec/reek/smell_detectors/attribute_spec.rb +32 -32
- data/spec/reek/smell_detectors/base_detector_spec.rb +3 -6
- data/spec/reek/smell_detectors/boolean_parameter_spec.rb +4 -4
- data/spec/reek/smell_detectors/class_variable_spec.rb +16 -16
- data/spec/reek/smell_detectors/control_parameter_spec.rb +33 -16
- data/spec/reek/smell_detectors/data_clump_spec.rb +16 -16
- data/spec/reek/smell_detectors/duplicate_method_call_spec.rb +20 -20
- data/spec/reek/smell_detectors/feature_envy_spec.rb +71 -26
- data/spec/reek/smell_detectors/instance_variable_assumption_spec.rb +12 -12
- data/spec/reek/smell_detectors/irresponsible_module_spec.rb +36 -36
- data/spec/reek/smell_detectors/long_parameter_list_spec.rb +6 -6
- data/spec/reek/smell_detectors/long_yield_list_spec.rb +6 -6
- data/spec/reek/smell_detectors/manual_dispatch_spec.rb +10 -10
- data/spec/reek/smell_detectors/{prima_donna_method_spec.rb → missing_safe_method_spec.rb} +17 -17
- data/spec/reek/smell_detectors/module_initialize_spec.rb +12 -12
- data/spec/reek/smell_detectors/nested_iterators_spec.rb +48 -48
- data/spec/reek/smell_detectors/nil_check_spec.rb +16 -16
- data/spec/reek/smell_detectors/repeated_conditional_spec.rb +8 -8
- data/spec/reek/smell_detectors/subclassed_from_core_class_spec.rb +10 -10
- data/spec/reek/smell_detectors/too_many_constants_spec.rb +25 -25
- data/spec/reek/smell_detectors/too_many_instance_variables_spec.rb +17 -17
- data/spec/reek/smell_detectors/too_many_methods_spec.rb +6 -6
- data/spec/reek/smell_detectors/too_many_statements_spec.rb +10 -10
- data/spec/reek/smell_detectors/uncommunicative_method_name_spec.rb +8 -8
- data/spec/reek/smell_detectors/uncommunicative_module_name_spec.rb +8 -6
- data/spec/reek/smell_detectors/uncommunicative_parameter_name_spec.rb +11 -9
- data/spec/reek/smell_detectors/uncommunicative_variable_name_spec.rb +24 -24
- data/spec/reek/smell_detectors/unused_parameters_spec.rb +4 -4
- data/spec/reek/smell_detectors/unused_private_method_spec.rb +25 -25
- data/spec/reek/smell_detectors/utility_function_spec.rb +30 -30
- data/spec/reek/smell_warning_spec.rb +21 -28
- data/spec/reek/source/source_code_spec.rb +16 -22
- data/spec/reek/source/source_locator_spec.rb +16 -17
- data/spec/reek/spec/should_reek_of_spec.rb +2 -6
- data/spec/reek/spec/should_reek_only_of_spec.rb +8 -15
- data/spec/reek/spec/should_reek_spec.rb +1 -1
- data/spec/reek/spec/smell_matcher_spec.rb +1 -2
- data/spec/reek/tree_dresser_spec.rb +2 -6
- data/spec/spec_helper.rb +5 -5
- data/tasks/configuration.rake +9 -5
- data/tasks/test.rake +4 -0
- metadata +89 -43
- data/.codeclimate.yml +0 -21
- data/ataru_setup.rb +0 -13
- data/defaults.reek +0 -131
- data/features/configuration_files/warn_about_multiple_configuration_files.feature +0 -44
- data/lib/reek/ast/sexp_extensions/attribute_assignments.rb +0 -14
- data/lib/reek/ast/sexp_extensions/literal.rb +0 -14
- 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 -36
- data/lib/reek/report/formatter.rb +0 -33
- 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_non_ruby_files/uncommunicative_parameter_name.rb +0 -6
- data/spec/reek/smell_detectors/syntax_spec.rb +0 -17
- data/tasks/ataru.rake +0 -5
- /data/{samples/configuration/more_than_one_configuration_file/regular.reek → .reek.yml} +0 -0
- /data/samples/{clean.rb → clean_source/clean.rb} +0 -0
- /data/samples/{exceptions.reek → configuration/home/home.reek.yml} +0 -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/{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/uncommunicative_parameter_name.rb → source_with_non_ruby_files/ruby.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da76dfc3aa1c997bffe832e526907dcf847cb5d86e04bc7c084abe074247e5d7
|
|
4
|
+
data.tar.gz: 7abc545f4176d0f561797c092bea15f1630b824a3d3ba37b99975450eb3ec3df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fe6f93cf2fe75c232327e1250c4e72c10c88707ce57879341f43b5a8a195ddb0282d9433e60cb19f635923edcb3fa52bbaadb187b5ee67d4b4cea7fc72ce901
|
|
7
|
+
data.tar.gz: a55abca10a6875077fda0b873667407f1dddf1840963fd6463ed918db9d9e58408fa93acf5a7e4741d9d488dede75963ad422c2150953e3d69f7af840a563dfd
|
data/.rubocop.yml
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
2
|
+
|
|
1
3
|
require:
|
|
2
4
|
- rubocop-rspec
|
|
5
|
+
- rubocop-performance
|
|
3
6
|
|
|
4
7
|
AllCops:
|
|
5
8
|
Exclude:
|
|
6
9
|
- 'samples/**/*'
|
|
7
10
|
- 'tmp/**/*'
|
|
8
11
|
- 'vendor/**/*'
|
|
9
|
-
TargetRubyVersion: 2.
|
|
12
|
+
TargetRubyVersion: 2.3
|
|
13
|
+
|
|
14
|
+
# Tables are nice
|
|
15
|
+
Layout/HashAlignment:
|
|
16
|
+
EnforcedColonStyle: table
|
|
17
|
+
EnforcedHashRocketStyle: table
|
|
18
|
+
EnforcedLastArgumentHashStyle: ignore_implicit
|
|
10
19
|
|
|
11
20
|
# Place . on the previous line
|
|
12
21
|
Layout/DotPosition:
|
|
@@ -16,9 +25,9 @@ Layout/DotPosition:
|
|
|
16
25
|
Layout/EmptyLineBetweenDefs:
|
|
17
26
|
AllowAdjacentOneLineDefs: true
|
|
18
27
|
|
|
19
|
-
#
|
|
20
|
-
Layout/
|
|
21
|
-
|
|
28
|
+
# Be rather lenient with line length
|
|
29
|
+
Layout/LineLength:
|
|
30
|
+
Max: 120
|
|
22
31
|
|
|
23
32
|
# Always put the closing brace on the last line
|
|
24
33
|
Layout/MultilineMethodCallBraceLayout:
|
|
@@ -45,81 +54,28 @@ Lint/InterpolationCheck:
|
|
|
45
54
|
Lint/BooleanSymbol:
|
|
46
55
|
Enabled: false
|
|
47
56
|
|
|
48
|
-
Lint/HandleExceptions:
|
|
49
|
-
Exclude:
|
|
50
|
-
- 'spec/reek/configuration/configuration_file_finder_spec.rb'
|
|
51
|
-
|
|
52
57
|
# Spec blocks can be any size
|
|
53
58
|
Metrics/BlockLength:
|
|
54
59
|
Exclude:
|
|
55
60
|
- 'spec/**/*'
|
|
56
61
|
|
|
57
|
-
# FIXME: Make the class shorter
|
|
58
|
-
Metrics/ClassLength:
|
|
59
|
-
Exclude:
|
|
60
|
-
- lib/reek/context_builder.rb
|
|
61
|
-
- lib/reek/cli/options.rb
|
|
62
|
-
|
|
63
|
-
# FIXME: Lower the method length by fixing the biggest offenders
|
|
64
|
-
Metrics/MethodLength:
|
|
65
|
-
Max: 15
|
|
66
|
-
|
|
67
|
-
# Be rather lenient with line length
|
|
68
|
-
Metrics/LineLength:
|
|
69
|
-
Max: 120
|
|
70
|
-
|
|
71
62
|
# Keyword arguments make long parameter lists readable
|
|
72
63
|
Metrics/ParameterLists:
|
|
73
64
|
CountKeywordArgs: false
|
|
74
65
|
|
|
75
|
-
Naming/
|
|
76
|
-
|
|
77
|
-
- 'lib/reek/context/visibility_tracker.rb'
|
|
78
|
-
|
|
79
|
-
# EOS is a fine name to use in our specs
|
|
80
|
-
Naming/HeredocDelimiterNaming:
|
|
81
|
-
Exclude:
|
|
82
|
-
- 'spec/**/*'
|
|
83
|
-
|
|
84
|
-
# FIXME: Update specs to avoid offenses
|
|
85
|
-
RSpec/AnyInstance:
|
|
86
|
-
Exclude:
|
|
87
|
-
- 'spec/reek/cli/application_spec.rb'
|
|
66
|
+
Naming/RescuedExceptionsVariableName:
|
|
67
|
+
PreferredName: error
|
|
88
68
|
|
|
89
|
-
#
|
|
69
|
+
# These files do not test classes or modules
|
|
90
70
|
RSpec/DescribeClass:
|
|
91
71
|
Exclude:
|
|
92
|
-
- 'spec/quality
|
|
72
|
+
- 'spec/quality/*_spec.rb'
|
|
73
|
+
- 'spec/performance/reek/smell_detectors/runtime_speed_spec.rb'
|
|
93
74
|
|
|
94
75
|
# Our examples are large because we have source literals in them
|
|
95
76
|
RSpec/ExampleLength:
|
|
96
77
|
Enabled: false
|
|
97
78
|
|
|
98
|
-
# FIXME: Split up files to avoid offenses
|
|
99
|
-
RSpec/MultipleDescribes:
|
|
100
|
-
Exclude:
|
|
101
|
-
- 'spec/reek/ast/sexp_extensions_spec.rb'
|
|
102
|
-
- 'spec/reek/code_comment_spec.rb'
|
|
103
|
-
- 'spec/reek/report/formatter/location_formatter_spec.rb'
|
|
104
|
-
- 'spec/reek/report/formatter/progress_formatter_spec.rb'
|
|
105
|
-
|
|
106
|
-
# FIXME: Update specs to avoid offenses
|
|
107
|
-
RSpec/MultipleExpectations:
|
|
108
|
-
Exclude:
|
|
109
|
-
- 'spec/reek/cli/application_spec.rb'
|
|
110
|
-
- 'spec/reek/code_comment_spec.rb'
|
|
111
|
-
- 'spec/reek/configuration/app_configuration_spec.rb'
|
|
112
|
-
- 'spec/reek/context/module_context_spec.rb'
|
|
113
|
-
- 'spec/reek/context_builder_spec.rb'
|
|
114
|
-
- 'spec/reek/examiner_spec.rb'
|
|
115
|
-
- 'spec/reek/spec/should_reek_of_spec.rb'
|
|
116
|
-
|
|
117
|
-
# FIXME: Update specs to avoid offenses
|
|
118
|
-
RSpec/NestedGroups:
|
|
119
|
-
Exclude:
|
|
120
|
-
- 'spec/reek/report/code_climate/code_climate_fingerprint_spec.rb'
|
|
121
|
-
- 'spec/reek/cli/application_spec.rb'
|
|
122
|
-
|
|
123
79
|
# rubocop-rspec expects a CodeClimate namespace to go with the code_climate directory.
|
|
124
80
|
RSpec/FilePath:
|
|
125
81
|
Exclude:
|
|
@@ -132,12 +88,6 @@ RSpec/FilePath:
|
|
|
132
88
|
Style/AndOr:
|
|
133
89
|
EnforcedStyle: conditionals
|
|
134
90
|
|
|
135
|
-
Style/Documentation:
|
|
136
|
-
Exclude:
|
|
137
|
-
- 'lib/reek/ast/sexp_extensions/send.rb'
|
|
138
|
-
- 'lib/reek/ast/sexp_extensions/super.rb'
|
|
139
|
-
- 'lib/reek/ast/sexp_extensions/variables.rb'
|
|
140
|
-
|
|
141
91
|
# Require comment for files in lib and bin
|
|
142
92
|
Style/FrozenStringLiteralComment:
|
|
143
93
|
Include:
|
|
@@ -176,3 +126,7 @@ Style/SymbolArray:
|
|
|
176
126
|
# Allow small arrays of words with quotes
|
|
177
127
|
Style/WordArray:
|
|
178
128
|
MinSize: 4
|
|
129
|
+
|
|
130
|
+
Metrics/ClassLength:
|
|
131
|
+
Exclude:
|
|
132
|
+
- 'lib/reek/cli/options.rb'
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config`
|
|
3
|
+
# on 2019-12-22 13:19:30 +0100 using RuboCop version 0.78.0.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 3
|
|
10
|
+
Metrics/AbcSize:
|
|
11
|
+
Max: 21
|
|
12
|
+
|
|
13
|
+
# Offense count: 1
|
|
14
|
+
# Configuration parameters: CountComments.
|
|
15
|
+
Metrics/ClassLength:
|
|
16
|
+
Max: 161
|
|
17
|
+
|
|
18
|
+
# Offense count: 14
|
|
19
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
|
20
|
+
Metrics/MethodLength:
|
|
21
|
+
Max: 16
|
|
22
|
+
|
|
23
|
+
# Offense count: 2
|
|
24
|
+
RSpec/AnyInstance:
|
|
25
|
+
Exclude:
|
|
26
|
+
- 'spec/reek/cli/application_spec.rb'
|
|
27
|
+
|
|
28
|
+
# Offense count: 1
|
|
29
|
+
# Configuration parameters: CustomIncludeMethods.
|
|
30
|
+
RSpec/EmptyExampleGroup:
|
|
31
|
+
Exclude:
|
|
32
|
+
- 'spec/factories/factories.rb'
|
|
33
|
+
|
|
34
|
+
# Offense count: 1
|
|
35
|
+
RSpec/MissingExampleGroupArgument:
|
|
36
|
+
Exclude:
|
|
37
|
+
- 'spec/factories/factories.rb'
|
|
38
|
+
|
|
39
|
+
# Offense count: 4
|
|
40
|
+
RSpec/MultipleDescribes:
|
|
41
|
+
Exclude:
|
|
42
|
+
- 'spec/reek/ast/sexp_extensions_spec.rb'
|
|
43
|
+
- 'spec/reek/code_comment_spec.rb'
|
|
44
|
+
- 'spec/reek/report/location_formatter_spec.rb'
|
|
45
|
+
- 'spec/reek/report/progress_formatter_spec.rb'
|
|
46
|
+
|
|
47
|
+
# Offense count: 32
|
|
48
|
+
# Configuration parameters: AggregateFailuresByDefault.
|
|
49
|
+
RSpec/MultipleExpectations:
|
|
50
|
+
Max: 5
|
|
51
|
+
|
|
52
|
+
# Offense count: 25
|
|
53
|
+
RSpec/NestedGroups:
|
|
54
|
+
Max: 5
|
|
55
|
+
|
|
56
|
+
# Offense count: 2
|
|
57
|
+
# Cop supports --auto-correct.
|
|
58
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
|
59
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
60
|
+
Style/SafeNavigation:
|
|
61
|
+
Exclude:
|
|
62
|
+
- 'lib/reek/ast/node.rb'
|
|
63
|
+
- 'lib/reek/ast/sexp_extensions/module.rb'
|
data/.simplecov
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
SimpleCov.start do
|
|
2
2
|
track_files 'lib/**/*.rb'
|
|
3
3
|
add_filter 'lib/reek/version.rb' # version.rb is loaded too early to test
|
|
4
|
+
add_filter 'lib/reek/cli/options.rb' # tested mostly via integration tests
|
|
5
|
+
add_filter 'spec/'
|
|
6
|
+
add_filter 'samples/'
|
|
7
|
+
coverage_dir 'tmp/coverage'
|
|
4
8
|
end
|
|
5
9
|
|
|
6
10
|
SimpleCov.at_exit do
|
|
7
11
|
SimpleCov.result.format!
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
unless RUBY_ENGINE == 'jruby'
|
|
13
|
+
SimpleCov.minimum_coverage 98.88
|
|
14
|
+
SimpleCov.minimum_coverage_by_file 81.4
|
|
15
|
+
end
|
|
10
16
|
end
|
data/.travis.yml
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
sudo: false
|
|
2
1
|
dist: trusty
|
|
3
2
|
cache: bundler
|
|
4
3
|
language: ruby
|
|
5
|
-
before_install:
|
|
6
|
-
- gem update --system
|
|
7
|
-
- gem install bundler
|
|
8
4
|
bundler_args: --without debugging
|
|
5
|
+
before_script:
|
|
6
|
+
# Avoid Java announcing _JAVA_OPTIONS environment variable
|
|
7
|
+
# See https://github.com/travis-ci/travis-ci/issues/8408
|
|
8
|
+
- unset _JAVA_OPTIONS
|
|
9
9
|
script: bundle exec rake ci
|
|
10
10
|
rvm:
|
|
11
|
-
- 2.1
|
|
12
|
-
- 2.2
|
|
13
11
|
- 2.3
|
|
14
12
|
- 2.4
|
|
15
13
|
- 2.5
|
|
16
|
-
-
|
|
14
|
+
- 2.6
|
|
15
|
+
- 2.7
|
|
16
|
+
- jruby-9.1.17.0
|
|
17
|
+
- jruby-9.2.6.0
|
|
17
18
|
- jruby-head
|
|
18
19
|
- ruby-head
|
|
19
20
|
- rubinius-3
|
|
20
21
|
matrix:
|
|
21
22
|
allow_failures:
|
|
22
|
-
- rvm: jruby-9.1.15.0
|
|
23
23
|
- rvm: jruby-head
|
|
24
24
|
- rvm: ruby-head
|
|
25
25
|
- rvm: rubinius-3
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
+
## 5.6.0 (2020-01-20)
|
|
4
|
+
|
|
5
|
+
* (mvz) Support Ruby 2.7
|
|
6
|
+
* (mvz) Loosen parser dependency to allow version 2.7.x
|
|
7
|
+
|
|
8
|
+
## 5.5.0 (2019-11-13)
|
|
9
|
+
|
|
10
|
+
* (mvz) Use the Parser class matching current ruby for parsing, instead of
|
|
11
|
+
always picking version 2.6.
|
|
12
|
+
|
|
13
|
+
## 5.4.1 (2019-11-12)
|
|
14
|
+
|
|
15
|
+
* (Filipe Esperandio) Bump base Docker image to a more recent ruby version
|
|
16
|
+
* (Fernando Contreras) Add quotes inside directory configuration example in
|
|
17
|
+
README
|
|
18
|
+
|
|
19
|
+
## 5.4.0 (2019-04-24)
|
|
20
|
+
|
|
21
|
+
* (Philippe Bernery) Enable regex for directory directives.
|
|
22
|
+
|
|
23
|
+
## 5.3.2 (2019-03-22)
|
|
24
|
+
|
|
25
|
+
* (troessner) Use Parser26.
|
|
26
|
+
|
|
27
|
+
## 5.3.1 (2019-02-08)
|
|
28
|
+
|
|
29
|
+
* (Al Snow) Upgrade parser dependency
|
|
30
|
+
|
|
31
|
+
## 5.3.0 (2018-12-28)
|
|
32
|
+
|
|
33
|
+
* (mvz) Add support for Ruby 2.6.
|
|
34
|
+
* (mvz) Add support for JRuby 9.1 and 9.2
|
|
35
|
+
|
|
36
|
+
## 5.2.0 (2018-10-13)
|
|
37
|
+
|
|
38
|
+
* (troessner) Enable exclusion of single files.
|
|
39
|
+
|
|
40
|
+
## 5.1.0 (2018-09-22)
|
|
41
|
+
|
|
42
|
+
* (troessner) Simplify todo list feature.
|
|
43
|
+
* (troessner) Show configuration path.
|
|
44
|
+
|
|
45
|
+
## 5.0.2 (2018-07-10)
|
|
46
|
+
|
|
47
|
+
* (mvz) Parser 2.5.1.1 seems broken. Disallow it.
|
|
48
|
+
* (mvz) Improve control parameter recursion performance.
|
|
49
|
+
|
|
50
|
+
## 5.0.1 (2018-07-03)
|
|
51
|
+
|
|
52
|
+
* (troessner) Fix uninitialized constant error
|
|
53
|
+
|
|
54
|
+
## 5.0.0 (2018-06-18)
|
|
55
|
+
|
|
56
|
+
*Breaking changes:*
|
|
57
|
+
|
|
58
|
+
* (David Fisher) Change PrimaDonnaMethod to MissingSafeMethod
|
|
59
|
+
* (mvz) Always include documentation in JSON and YAML
|
|
60
|
+
* (mvz) Remove Syntax smell detector
|
|
61
|
+
* (mvz) Remove deprecated Examiner#description (in favor of Examiner#origin)
|
|
62
|
+
* (mvz) Allow only detector names in configuration hash
|
|
63
|
+
* (mvz) Do not accept a class as parameter for reek_of
|
|
64
|
+
* (mvz) Allow only .reek.yml instead of any file name ending in .reek
|
|
65
|
+
* (troessner) Validate our configuration by using a schema
|
|
66
|
+
* (troessner) Scope detectors in the configuration under `detectors`
|
|
67
|
+
* (troessner) Move directory directives under a special key
|
|
68
|
+
* (troessner) Use strings not regexes in our configuration file
|
|
69
|
+
* (troessner) Replace `wiki-links` flag with `documentation` flag
|
|
70
|
+
* (troessner) Add yml extension to Reeks configuration file
|
|
71
|
+
* (troessner) Drop legacy code comment separator
|
|
72
|
+
* (troessner) Drop Ruby 2.2 support
|
|
73
|
+
* (troessner) Drop Ruby 2.1 support
|
|
74
|
+
|
|
75
|
+
*Non breaking changes:*
|
|
76
|
+
|
|
77
|
+
* (Paul Sadauskas) Add support for --stdin-filename
|
|
78
|
+
* (mvz) Generate versioned documentation links
|
|
79
|
+
* (mvz) Bugfix: Only report FeatureEnvy for instance methods
|
|
80
|
+
* (troessner) List all smells
|
|
81
|
+
|
|
82
|
+
## 4.8.2 (2018-06-26)
|
|
83
|
+
|
|
84
|
+
* (mvz) Only report FeatureEnvy for instance methods
|
|
85
|
+
* (mvz) Generate versioned documentation links
|
|
86
|
+
|
|
3
87
|
## 4.8.1 (2018-04-12)
|
|
4
88
|
|
|
5
89
|
* (mvz) Loosen dependency on rainbow
|
data/CONTRIBUTING.md
CHANGED
|
@@ -89,6 +89,14 @@ class Alfa
|
|
|
89
89
|
end
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
We also aim to make our specs as self-reliant as possible. They should not rely on external sample
|
|
93
|
+
or configuration files since that makes it very hard to reason about them and introduces a tight coupling
|
|
94
|
+
which makes refactoring more difficult.
|
|
95
|
+
Unfortunately our current specs are a bit misleading in this regard since they are often doing the
|
|
96
|
+
opposite, relying on external sample and configuration files (indicated by using
|
|
97
|
+
some of the constants defined in `samples/paths.rb`).
|
|
98
|
+
Our goal is to reverse this development.
|
|
99
|
+
|
|
92
100
|
### Cucumber Features
|
|
93
101
|
|
|
94
102
|
Reek uses [Cucumber](https://cucumber.io/) with
|
|
@@ -182,3 +190,20 @@ We are following [semantic versioning](http://semver.org/).
|
|
|
182
190
|
If you're working on a change that is breaking backwards-compatibility
|
|
183
191
|
just go ahead with your pull request like normal. We'll discuss this then in
|
|
184
192
|
the pull request and help you to point your pull request to the right branch.
|
|
193
|
+
|
|
194
|
+
### Releasing Reek
|
|
195
|
+
|
|
196
|
+
In this example we assume the current version is 5.3.1 and you want to update to 5.3.2.
|
|
197
|
+
|
|
198
|
+
* Create a branch with a name like "prepare-v.5.3.2"
|
|
199
|
+
* Update the version in `lib/reek/version.rb`
|
|
200
|
+
* List all relevant changes in `CHANGELOG.md`
|
|
201
|
+
* Update the version number in our cucumber features, otherwise the build will fail. You can do this quite easily via
|
|
202
|
+
```Bash
|
|
203
|
+
find features/ -type f -exec sed -i '' 's/v5.3.1/v5.3.2/g' {} +
|
|
204
|
+
```
|
|
205
|
+
* Push the branch, create a pull request, have it reviewed and merged
|
|
206
|
+
* Pull the latest master and then do a
|
|
207
|
+
```Bash
|
|
208
|
+
bundle exec rake release
|
|
209
|
+
```
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
|
@@ -5,32 +5,28 @@ gemspec
|
|
|
5
5
|
ruby RUBY_VERSION
|
|
6
6
|
|
|
7
7
|
group :development do
|
|
8
|
-
gem '
|
|
9
|
-
gem '
|
|
10
|
-
gem '
|
|
11
|
-
gem '
|
|
12
|
-
gem '
|
|
13
|
-
gem 'rake',
|
|
14
|
-
gem 'rspec',
|
|
15
|
-
gem '
|
|
16
|
-
gem '
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
end
|
|
8
|
+
gem 'aruba', '~> 0.14.8'
|
|
9
|
+
gem 'cucumber', '~> 3.0'
|
|
10
|
+
gem 'factory_bot', '~> 5.0', '!= 5.1.0'
|
|
11
|
+
gem 'kramdown', '~> 2.1'
|
|
12
|
+
gem 'kramdown-parser-gfm', '~> 1.0'
|
|
13
|
+
gem 'rake', '~> 13.0'
|
|
14
|
+
gem 'rspec', '~> 3.0'
|
|
15
|
+
gem 'rspec-benchmark', '~> 0.5.0'
|
|
16
|
+
gem 'rubocop', '~> 0.79.0'
|
|
17
|
+
gem 'rubocop-performance', '~> 1.5.0'
|
|
18
|
+
gem 'rubocop-rspec', '~> 1.37.0'
|
|
19
|
+
gem 'simplecov', '~> 0.17.0'
|
|
20
|
+
gem 'yard', '~> 0.9.5'
|
|
22
21
|
|
|
23
22
|
platforms :mri do
|
|
24
|
-
gem 'redcarpet', '~> 3.4
|
|
23
|
+
gem 'redcarpet', '~> 3.4'
|
|
25
24
|
end
|
|
26
25
|
end
|
|
27
26
|
|
|
28
27
|
group :debugging do
|
|
29
|
-
# Fixing https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X#option-4-using-a-pure-ruby-readline-implementation
|
|
30
28
|
gem 'pry'
|
|
31
|
-
gem 'rb-readline', '~> 0.5.3'
|
|
32
29
|
platforms :mri do
|
|
33
30
|
gem 'pry-byebug'
|
|
34
|
-
gem 'pry-stack_explorer'
|
|
35
31
|
end
|
|
36
32
|
end
|