reek 4.6.0 → 5.0.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/.codeclimate.yml +17 -12
- data/.rubocop.yml +79 -26
- data/.simplecov +1 -0
- data/.travis.yml +3 -9
- data/.yardopts +1 -1
- data/CHANGELOG.md +76 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +5 -5
- data/README.md +138 -107
- data/Rakefile +16 -3
- data/bin/code_climate_reek +1 -0
- data/bin/reek +2 -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 +7 -7
- data/docs/Instance-Variable-Assumption.md +1 -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 +193 -0
- data/docs/Reek-Driven-Development.md +1 -1
- 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 +3 -3
- data/docs/defaults.reek.yml +129 -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 +46 -4
- 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 +31 -5
- data/features/configuration_files/accept_setting.feature +45 -28
- data/features/configuration_files/directory_specific_directives.feature +80 -75
- data/features/configuration_files/exclude_directives.feature +11 -10
- data/features/configuration_files/exclude_paths_directives.feature +4 -4
- 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/unused_private_method.feature +18 -16
- data/features/configuration_loading.feature +53 -10
- data/features/configuration_via_source_comments/erroneous_source_comments.feature +3 -3
- data/features/configuration_via_source_comments/well_formed_source_comments.feature +2 -2
- data/features/locales.feature +32 -0
- data/features/rake_task/rake_task.feature +58 -18
- data/features/reports/codeclimate.feature +59 -0
- 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 +40 -0
- data/features/samples.feature +287 -287
- data/features/step_definitions/reek_steps.rb +14 -2
- data/features/step_definitions/sample_file_steps.rb +9 -4
- data/features/support/env.rb +2 -11
- data/features/todo_list.feature +26 -23
- data/lib/reek/ast/ast_node_class_map.rb +1 -0
- data/lib/reek/ast/builder.rb +16 -0
- data/lib/reek/ast/node.rb +50 -58
- data/lib/reek/ast/object_refs.rb +2 -1
- data/lib/reek/ast/reference_collector.rb +3 -4
- data/lib/reek/ast/sexp_extensions/arguments.rb +1 -0
- data/lib/reek/ast/sexp_extensions/attribute_assignments.rb +1 -0
- data/lib/reek/ast/sexp_extensions/begin.rb +17 -0
- data/lib/reek/ast/sexp_extensions/block.rb +1 -0
- data/lib/reek/ast/sexp_extensions/case.rb +2 -1
- data/lib/reek/ast/sexp_extensions/constant.rb +1 -0
- data/lib/reek/ast/sexp_extensions/if.rb +9 -1
- data/lib/reek/ast/sexp_extensions/lambda.rb +1 -0
- data/lib/reek/ast/sexp_extensions/literal.rb +1 -0
- data/lib/reek/ast/sexp_extensions/logical_operators.rb +2 -1
- data/lib/reek/ast/sexp_extensions/methods.rb +5 -6
- data/lib/reek/ast/sexp_extensions/module.rb +55 -8
- data/lib/reek/ast/sexp_extensions/nested_assignables.rb +1 -0
- data/lib/reek/ast/sexp_extensions/self.rb +1 -0
- data/lib/reek/ast/sexp_extensions/send.rb +1 -4
- data/lib/reek/ast/sexp_extensions/super.rb +1 -0
- data/lib/reek/ast/sexp_extensions/symbols.rb +1 -0
- data/lib/reek/ast/sexp_extensions/variables.rb +1 -0
- data/lib/reek/ast/sexp_extensions/when.rb +1 -0
- data/lib/reek/ast/sexp_extensions/yield.rb +1 -0
- data/lib/reek/ast/sexp_extensions.rb +2 -0
- data/lib/reek/cli/application.rb +5 -3
- data/lib/reek/cli/command/base_command.rb +1 -0
- data/lib/reek/cli/command/report_command.rb +2 -2
- data/lib/reek/cli/command/todo_list_command.rb +9 -8
- data/lib/reek/cli/options.rb +32 -16
- data/lib/reek/cli/silencer.rb +15 -3
- data/lib/reek/cli/status.rb +1 -0
- data/lib/reek/code_comment.rb +14 -16
- data/lib/reek/configuration/app_configuration.rb +34 -28
- data/lib/reek/configuration/configuration_converter.rb +110 -0
- data/lib/reek/configuration/configuration_file_finder.rb +17 -41
- data/lib/reek/configuration/configuration_validator.rb +13 -23
- data/lib/reek/configuration/default_directive.rb +18 -3
- data/lib/reek/configuration/directory_directives.rb +18 -11
- data/lib/reek/configuration/excluded_paths.rb +2 -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 +4 -3
- data/lib/reek/context/class_context.rb +1 -0
- data/lib/reek/context/code_context.rb +49 -44
- data/lib/reek/context/ghost_context.rb +1 -2
- data/lib/reek/context/method_context.rb +26 -18
- data/lib/reek/context/module_context.rb +11 -11
- data/lib/reek/context/root_context.rb +1 -4
- data/lib/reek/context/send_context.rb +3 -2
- data/lib/reek/context/singleton_attribute_context.rb +1 -0
- data/lib/reek/context/singleton_method_context.rb +1 -0
- data/lib/reek/context/statement_counter.rb +1 -0
- data/lib/reek/context/visibility_tracker.rb +1 -0
- data/lib/reek/context_builder.rb +44 -44
- data/lib/reek/detector_repository.rb +12 -11
- data/lib/reek/documentation_link.rb +28 -0
- data/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb +15 -13
- data/lib/reek/errors/bad_detector_in_comment_error.rb +13 -11
- data/lib/reek/errors/base_error.rb +3 -0
- data/lib/reek/errors/config_file_error.rb +11 -0
- data/lib/reek/errors/encoding_error.rb +43 -0
- data/lib/reek/errors/garbage_detector_configuration_in_comment_error.rb +14 -12
- data/lib/reek/errors/incomprehensible_source_error.rb +23 -24
- data/lib/reek/errors/syntax_error.rb +41 -0
- data/lib/reek/examiner.rb +24 -22
- data/lib/reek/logging_error_handler.rb +8 -5
- data/lib/reek/rake/task.rb +8 -5
- data/lib/reek/report/base_report.rb +9 -12
- data/lib/reek/report/code_climate/code_climate_configuration.rb +2 -1
- data/lib/reek/report/code_climate/code_climate_configuration.yml +6 -6
- data/lib/reek/report/code_climate/code_climate_fingerprint.rb +1 -0
- data/lib/reek/report/code_climate/code_climate_formatter.rb +1 -0
- data/lib/reek/report/code_climate/code_climate_report.rb +1 -0
- data/lib/reek/report/code_climate.rb +1 -0
- data/lib/reek/report/documentation_link_warning_formatter.rb +17 -0
- data/lib/reek/report/heading_formatter.rb +54 -0
- data/lib/reek/report/html_report.rb +1 -0
- data/lib/reek/report/json_report.rb +2 -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 +2 -2
- data/lib/reek/report/xml_report.rb +4 -3
- data/lib/reek/report/yaml_report.rb +2 -1
- data/lib/reek/report.rb +16 -10
- data/lib/reek/smell_configuration.rb +3 -2
- data/lib/reek/smell_detectors/attribute.rb +6 -11
- data/lib/reek/smell_detectors/base_detector.rb +31 -26
- data/lib/reek/smell_detectors/boolean_parameter.rb +4 -5
- data/lib/reek/smell_detectors/class_variable.rb +6 -14
- data/lib/reek/smell_detectors/control_parameter.rb +19 -33
- data/lib/reek/smell_detectors/data_clump.rb +16 -9
- data/lib/reek/smell_detectors/duplicate_method_call.rb +24 -17
- data/lib/reek/smell_detectors/feature_envy.rb +10 -7
- data/lib/reek/smell_detectors/instance_variable_assumption.rb +15 -23
- data/lib/reek/smell_detectors/irresponsible_module.rb +6 -12
- data/lib/reek/smell_detectors/long_parameter_list.rb +11 -7
- data/lib/reek/smell_detectors/long_yield_list.rb +11 -7
- data/lib/reek/smell_detectors/manual_dispatch.rb +5 -5
- data/lib/reek/smell_detectors/{prima_donna_method.rb → missing_safe_method.rb} +21 -20
- data/lib/reek/smell_detectors/module_initialize.rb +4 -5
- data/lib/reek/smell_detectors/nested_iterators.rb +17 -24
- data/lib/reek/smell_detectors/nil_check.rb +9 -15
- data/lib/reek/smell_detectors/repeated_conditional.rb +14 -11
- data/lib/reek/smell_detectors/subclassed_from_core_class.rb +8 -8
- data/lib/reek/smell_detectors/too_many_constants.rb +11 -9
- data/lib/reek/smell_detectors/too_many_instance_variables.rb +11 -6
- data/lib/reek/smell_detectors/too_many_methods.rb +12 -7
- data/lib/reek/smell_detectors/too_many_statements.rb +11 -6
- data/lib/reek/smell_detectors/uncommunicative_method_name.rb +11 -11
- data/lib/reek/smell_detectors/uncommunicative_module_name.rb +15 -18
- data/lib/reek/smell_detectors/uncommunicative_parameter_name.rb +18 -22
- data/lib/reek/smell_detectors/uncommunicative_variable_name.rb +27 -27
- data/lib/reek/smell_detectors/unused_parameters.rb +5 -6
- data/lib/reek/smell_detectors/unused_private_method.rb +14 -20
- data/lib/reek/smell_detectors/utility_function.rb +13 -16
- data/lib/reek/smell_detectors.rb +2 -1
- data/lib/reek/smell_warning.rb +16 -8
- data/lib/reek/source/source_code.rb +65 -46
- data/lib/reek/source/source_locator.rb +9 -8
- data/lib/reek/spec/should_reek.rb +3 -2
- data/lib/reek/spec/should_reek_of.rb +13 -26
- data/lib/reek/spec/should_reek_only_of.rb +5 -4
- data/lib/reek/spec/smell_matcher.rb +2 -1
- data/lib/reek/spec.rb +7 -6
- data/lib/reek/tree_dresser.rb +9 -8
- data/lib/reek/version.rb +2 -1
- data/lib/reek.rb +1 -0
- data/reek.gemspec +5 -6
- 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/paths.rb +5 -4
- 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 +2 -13
- data/spec/reek/ast/node_spec.rb +103 -10
- data/spec/reek/ast/reference_collector_spec.rb +1 -1
- data/spec/reek/ast/sexp_extensions_spec.rb +15 -34
- data/spec/reek/cli/application_spec.rb +52 -42
- data/spec/reek/cli/command/todo_list_command_spec.rb +6 -4
- data/spec/reek/cli/silencer_spec.rb +28 -0
- data/spec/reek/code_comment_spec.rb +31 -38
- data/spec/reek/configuration/app_configuration_spec.rb +46 -33
- data/spec/reek/configuration/configuration_file_finder_spec.rb +133 -51
- data/spec/reek/configuration/default_directive_spec.rb +1 -1
- data/spec/reek/configuration/directory_directives_spec.rb +6 -7
- data/spec/reek/configuration/excluded_paths_spec.rb +6 -6
- 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 +70 -106
- data/spec/reek/context/ghost_context_spec.rb +9 -9
- data/spec/reek/context/method_context_spec.rb +2 -2
- data/spec/reek/context/module_context_spec.rb +3 -3
- data/spec/reek/context/root_context_spec.rb +1 -1
- data/spec/reek/context/statement_counter_spec.rb +1 -0
- data/spec/reek/context_builder_spec.rb +20 -0
- data/spec/reek/documentation_link_spec.rb +20 -0
- data/spec/reek/errors/base_error_spec.rb +13 -0
- data/spec/reek/examiner_spec.rb +137 -29
- data/spec/reek/rake/task_spec.rb +25 -2
- data/spec/reek/report/code_climate/code_climate_fingerprint_spec.rb +82 -78
- data/spec/reek/report/code_climate/code_climate_formatter_spec.rb +6 -6
- data/spec/reek/report/code_climate/code_climate_report_spec.rb +22 -22
- 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 +3 -3
- data/spec/reek/report/yaml_report_spec.rb +17 -46
- data/spec/reek/report_spec.rb +3 -3
- data/spec/reek/smell_detectors/base_detector_spec.rb +4 -5
- data/spec/reek/smell_detectors/boolean_parameter_spec.rb +2 -2
- data/spec/reek/smell_detectors/class_variable_spec.rb +26 -32
- data/spec/reek/smell_detectors/control_parameter_spec.rb +34 -4
- data/spec/reek/smell_detectors/duplicate_method_call_spec.rb +3 -3
- data/spec/reek/smell_detectors/feature_envy_spec.rb +47 -2
- data/spec/reek/smell_detectors/irresponsible_module_spec.rb +59 -21
- data/spec/reek/smell_detectors/{prima_donna_method_spec.rb → missing_safe_method_spec.rb} +10 -10
- data/spec/reek/smell_detectors/module_initialize_spec.rb +14 -0
- data/spec/reek/smell_detectors/nested_iterators_spec.rb +1 -1
- 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 +36 -15
- data/spec/reek/smell_detectors/uncommunicative_variable_name_spec.rb +9 -9
- data/spec/reek/smell_detectors/unused_parameters_spec.rb +3 -3
- data/spec/reek/smell_detectors/unused_private_method_spec.rb +21 -10
- data/spec/reek/smell_detectors/utility_function_spec.rb +57 -5
- data/spec/reek/smell_warning_spec.rb +12 -8
- data/spec/reek/source/source_code_spec.rb +27 -38
- data/spec/reek/source/source_locator_spec.rb +42 -12
- data/spec/reek/spec/should_reek_of_spec.rb +25 -30
- data/spec/reek/spec/should_reek_only_of_spec.rb +2 -2
- data/spec/reek/spec/should_reek_spec.rb +8 -8
- data/spec/reek/spec/smell_matcher_spec.rb +23 -23
- data/spec/reek/tree_dresser_spec.rb +12 -17
- data/spec/spec_helper.rb +7 -17
- data/tasks/configuration.rake +8 -5
- metadata +77 -40
- data/defaults.reek +0 -128
- data/features/configuration_files/warn_about_multiple_configuration_files.feature +0 -44
- data/lib/reek/errors/parse_error.rb +0 -19
- data/lib/reek/report/formatter/heading_formatter.rb +0 -51
- data/lib/reek/report/formatter/location_formatter.rb +0 -41
- data/lib/reek/report/formatter/progress_formatter.rb +0 -80
- data/lib/reek/report/formatter/simple_warning_formatter.rb +0 -35
- data/lib/reek/report/formatter/wiki_link_warning_formatter.rb +0 -35
- data/lib/reek/report/formatter.rb +0 -32
- 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/{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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcc26f0cc3bb682d6af4ccd125c9968049fa7659
|
|
4
|
+
data.tar.gz: 3f07f95ea9d5dc2d9a3228d9720aa991ac1f5232
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: caeb105aa52968eb387304da206083cf07394d1f378c01a6aabf040e2aa264d0016491e69dba31910fa64982cdc8bf9902b036b63639279422c93ad934a91725
|
|
7
|
+
data.tar.gz: 8af65a286c9207f04770b530865755aeeca35b4162d3db66c987b0e6d5c02438faeeee3251bef91ef5e91e4b75235ec2ae23f805a07bfc64d448e7e5066610d6
|
data/.codeclimate.yml
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
version: "2"
|
|
2
|
+
plugins:
|
|
2
3
|
rubocop:
|
|
3
4
|
enabled: true
|
|
4
5
|
reek:
|
|
5
6
|
enabled: true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
7
|
+
duplication:
|
|
8
|
+
enabled: true
|
|
9
|
+
config:
|
|
10
|
+
languages:
|
|
11
|
+
ruby:
|
|
12
|
+
mass_threshold: 35
|
|
13
|
+
exclude_patterns:
|
|
14
|
+
- coverage/
|
|
15
|
+
- docs/
|
|
16
|
+
- features/
|
|
17
|
+
- logo/
|
|
18
|
+
- pkg/
|
|
19
|
+
- samples/
|
|
20
|
+
- spec/
|
|
21
|
+
- tmp/
|
data/.rubocop.yml
CHANGED
|
@@ -6,7 +6,44 @@ AllCops:
|
|
|
6
6
|
- 'samples/**/*'
|
|
7
7
|
- 'tmp/**/*'
|
|
8
8
|
- 'vendor/**/*'
|
|
9
|
-
TargetRubyVersion: 2.
|
|
9
|
+
TargetRubyVersion: 2.3
|
|
10
|
+
|
|
11
|
+
# Place . on the previous line
|
|
12
|
+
Layout/DotPosition:
|
|
13
|
+
EnforcedStyle: trailing
|
|
14
|
+
|
|
15
|
+
# Require empty lines between defs, except for one-line defs
|
|
16
|
+
Layout/EmptyLineBetweenDefs:
|
|
17
|
+
AllowAdjacentOneLineDefs: true
|
|
18
|
+
|
|
19
|
+
# Use active_support's strip_heredoc to indent heredocs
|
|
20
|
+
Layout/IndentHeredoc:
|
|
21
|
+
EnforcedStyle: active_support
|
|
22
|
+
|
|
23
|
+
# Always put the closing brace on the last line
|
|
24
|
+
Layout/MultilineMethodCallBraceLayout:
|
|
25
|
+
EnforcedStyle: same_line
|
|
26
|
+
|
|
27
|
+
# Indent one level for follow-up lines
|
|
28
|
+
Layout/MultilineMethodCallIndentation:
|
|
29
|
+
EnforcedStyle: indented
|
|
30
|
+
|
|
31
|
+
# Indent one level for follow-up lines
|
|
32
|
+
Layout/MultilineOperationIndentation:
|
|
33
|
+
EnforcedStyle: indented
|
|
34
|
+
|
|
35
|
+
# Assume the programmer knows how bracketed block syntax works
|
|
36
|
+
Lint/AmbiguousBlockAssociation:
|
|
37
|
+
Enabled: false
|
|
38
|
+
|
|
39
|
+
# Some of our source examples include interpolation explicitely.
|
|
40
|
+
Lint/InterpolationCheck:
|
|
41
|
+
Exclude:
|
|
42
|
+
- 'spec/**/*'
|
|
43
|
+
|
|
44
|
+
# We use :true and :false as AST node types.
|
|
45
|
+
Lint/BooleanSymbol:
|
|
46
|
+
Enabled: false
|
|
10
47
|
|
|
11
48
|
Lint/HandleExceptions:
|
|
12
49
|
Exclude:
|
|
@@ -23,9 +60,21 @@ Metrics/ClassLength:
|
|
|
23
60
|
- lib/reek/context_builder.rb
|
|
24
61
|
- lib/reek/cli/options.rb
|
|
25
62
|
|
|
63
|
+
Style/SafeNavigation:
|
|
64
|
+
Exclude:
|
|
65
|
+
- lib/reek/ast/node.rb
|
|
66
|
+
- lib/reek/ast/sexp_extensions/module.rb
|
|
67
|
+
|
|
26
68
|
# FIXME: Lower the method length by fixing the biggest offenders
|
|
27
69
|
Metrics/MethodLength:
|
|
28
70
|
Max: 15
|
|
71
|
+
Exclude:
|
|
72
|
+
- 'lib/reek/cli/options.rb'
|
|
73
|
+
|
|
74
|
+
Metrics/AbcSize:
|
|
75
|
+
Exclude:
|
|
76
|
+
- 'lib/reek/cli/options.rb'
|
|
77
|
+
- 'lib/reek/configuration/configuration_converter.rb'
|
|
29
78
|
|
|
30
79
|
# Be rather lenient with line length
|
|
31
80
|
Metrics/LineLength:
|
|
@@ -35,6 +84,15 @@ Metrics/LineLength:
|
|
|
35
84
|
Metrics/ParameterLists:
|
|
36
85
|
CountKeywordArgs: false
|
|
37
86
|
|
|
87
|
+
Naming/AccessorMethodName:
|
|
88
|
+
Exclude:
|
|
89
|
+
- 'lib/reek/context/visibility_tracker.rb'
|
|
90
|
+
|
|
91
|
+
# EOS is a fine name to use in our specs
|
|
92
|
+
Naming/HeredocDelimiterNaming:
|
|
93
|
+
Exclude:
|
|
94
|
+
- 'spec/**/*'
|
|
95
|
+
|
|
38
96
|
# FIXME: Update specs to avoid offenses
|
|
39
97
|
RSpec/AnyInstance:
|
|
40
98
|
Exclude:
|
|
@@ -54,8 +112,8 @@ RSpec/MultipleDescribes:
|
|
|
54
112
|
Exclude:
|
|
55
113
|
- 'spec/reek/ast/sexp_extensions_spec.rb'
|
|
56
114
|
- 'spec/reek/code_comment_spec.rb'
|
|
57
|
-
- 'spec/reek/report/
|
|
58
|
-
- 'spec/reek/report/
|
|
115
|
+
- 'spec/reek/report/location_formatter_spec.rb'
|
|
116
|
+
- 'spec/reek/report/progress_formatter_spec.rb'
|
|
59
117
|
|
|
60
118
|
# FIXME: Update specs to avoid offenses
|
|
61
119
|
RSpec/MultipleExpectations:
|
|
@@ -71,7 +129,10 @@ RSpec/MultipleExpectations:
|
|
|
71
129
|
# FIXME: Update specs to avoid offenses
|
|
72
130
|
RSpec/NestedGroups:
|
|
73
131
|
Exclude:
|
|
132
|
+
- 'spec/reek/report/code_climate/code_climate_fingerprint_spec.rb'
|
|
74
133
|
- 'spec/reek/cli/application_spec.rb'
|
|
134
|
+
- 'spec/reek/configuration/schema_validator_spec.rb'
|
|
135
|
+
- 'spec/reek/configuration/configuration_file_finder_spec.rb'
|
|
75
136
|
|
|
76
137
|
# rubocop-rspec expects a CodeClimate namespace to go with the code_climate directory.
|
|
77
138
|
RSpec/FilePath:
|
|
@@ -81,9 +142,9 @@ RSpec/FilePath:
|
|
|
81
142
|
- 'spec/reek/report/code_climate/code_climate_formatter_spec.rb'
|
|
82
143
|
- 'spec/reek/report/code_climate/code_climate_report_spec.rb'
|
|
83
144
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
145
|
+
# Allow and/or for control flow only
|
|
146
|
+
Style/AndOr:
|
|
147
|
+
EnforcedStyle: conditionals
|
|
87
148
|
|
|
88
149
|
Style/Documentation:
|
|
89
150
|
Exclude:
|
|
@@ -91,14 +152,6 @@ Style/Documentation:
|
|
|
91
152
|
- 'lib/reek/ast/sexp_extensions/super.rb'
|
|
92
153
|
- 'lib/reek/ast/sexp_extensions/variables.rb'
|
|
93
154
|
|
|
94
|
-
# Place . on the previous line
|
|
95
|
-
Style/DotPosition:
|
|
96
|
-
EnforcedStyle: trailing
|
|
97
|
-
|
|
98
|
-
# Require empty lines between defs, except for one-line defs
|
|
99
|
-
Style/EmptyLineBetweenDefs:
|
|
100
|
-
AllowAdjacentOneLineDefs: true
|
|
101
|
-
|
|
102
155
|
# Require comment for files in lib and bin
|
|
103
156
|
Style/FrozenStringLiteralComment:
|
|
104
157
|
Include:
|
|
@@ -110,22 +163,18 @@ Style/FrozenStringLiteralComment:
|
|
|
110
163
|
Style/MultilineBlockChain:
|
|
111
164
|
Enabled: false
|
|
112
165
|
|
|
113
|
-
# Always put the closing brace on the last line
|
|
114
|
-
Style/MultilineMethodCallBraceLayout:
|
|
115
|
-
EnforcedStyle: same_line
|
|
116
|
-
|
|
117
|
-
# Indent one level for follow-up lines
|
|
118
|
-
Style/MultilineMethodCallIndentation:
|
|
119
|
-
EnforcedStyle: indented
|
|
120
|
-
|
|
121
|
-
# Indent one level for follow-up lines
|
|
122
|
-
Style/MultilineOperationIndentation:
|
|
123
|
-
EnforcedStyle: indented
|
|
124
|
-
|
|
125
166
|
# There's nothing wrong with parallel assignment
|
|
126
167
|
Style/ParallelAssignment:
|
|
127
168
|
Enabled: false
|
|
128
169
|
|
|
170
|
+
Style/PercentLiteralDelimiters:
|
|
171
|
+
PreferredDelimiters:
|
|
172
|
+
default: ()
|
|
173
|
+
'%W': ()
|
|
174
|
+
'%I': ()
|
|
175
|
+
'%w': ()
|
|
176
|
+
'%i': ()
|
|
177
|
+
|
|
129
178
|
# Allow Perl-style references to regex matches
|
|
130
179
|
Style/PerlBackrefs:
|
|
131
180
|
Enabled: false
|
|
@@ -134,6 +183,10 @@ Style/PerlBackrefs:
|
|
|
134
183
|
Style/SingleLineMethods:
|
|
135
184
|
Enabled: false
|
|
136
185
|
|
|
186
|
+
# Prefer symbols to look like symbols
|
|
187
|
+
Style/SymbolArray:
|
|
188
|
+
EnforcedStyle: brackets
|
|
189
|
+
|
|
137
190
|
# Allow small arrays of words with quotes
|
|
138
191
|
Style/WordArray:
|
|
139
192
|
MinSize: 4
|
data/.simplecov
CHANGED
data/.travis.yml
CHANGED
|
@@ -5,26 +5,20 @@ language: ruby
|
|
|
5
5
|
bundler_args: --without debugging
|
|
6
6
|
script: bundle exec rake ci
|
|
7
7
|
rvm:
|
|
8
|
-
- 2.1
|
|
9
|
-
- 2.2
|
|
10
8
|
- 2.3
|
|
11
9
|
- 2.4
|
|
12
|
-
-
|
|
10
|
+
- 2.5
|
|
11
|
+
- jruby-9.1.15.0
|
|
13
12
|
- jruby-head
|
|
14
13
|
- ruby-head
|
|
15
14
|
- rubinius-3
|
|
16
15
|
matrix:
|
|
17
16
|
allow_failures:
|
|
18
|
-
- rvm: jruby-9.1.
|
|
17
|
+
- rvm: jruby-9.1.15.0
|
|
19
18
|
- rvm: jruby-head
|
|
20
19
|
- rvm: ruby-head
|
|
21
20
|
- rvm: rubinius-3
|
|
22
21
|
fast_finish: true
|
|
23
|
-
before_install:
|
|
24
|
-
- rvm use @global
|
|
25
|
-
- gem uninstall bundler -x
|
|
26
|
-
- gem install bundler --version=1.13.7
|
|
27
|
-
- bundler --version
|
|
28
22
|
notifications:
|
|
29
23
|
email:
|
|
30
24
|
- timo.roessner@googlemail.com
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
+
## 5.0.0 (2018-06-18)
|
|
4
|
+
|
|
5
|
+
*Breaking changes:*
|
|
6
|
+
|
|
7
|
+
* (David Fisher) Change PrimaDonnaMethod to MissingSafeMethod
|
|
8
|
+
* (mvz) Always include documentation in JSON and YAML
|
|
9
|
+
* (mvz) Remove Syntax smell detector
|
|
10
|
+
* (mvz) Remove deprecated Examiner#description (in favor of Examiner#origin)
|
|
11
|
+
* (mvz) Allow only detector names in configuration hash
|
|
12
|
+
* (mvz) Do not accept a class as parameter for reek_of
|
|
13
|
+
* (mvz) Allow only .reek.yml instead of any file name ending in .reek
|
|
14
|
+
* (troessner) Validate our configuration by using a schema
|
|
15
|
+
* (troessner) Scope detectors in the configuration under `detectors`
|
|
16
|
+
* (troessner) Move directory directives under a special key
|
|
17
|
+
* (troessner) Use strings not regexes in our configuration file
|
|
18
|
+
* (troessner) Replace `wiki-links` flag with `documentation` flag
|
|
19
|
+
* (troessner) Add yml extension to Reeks configuration file
|
|
20
|
+
* (troessner) Drop legacy code comment separator
|
|
21
|
+
* (troessner) Drop Ruby 2.2 support
|
|
22
|
+
* (troessner) Drop Ruby 2.1 support
|
|
23
|
+
|
|
24
|
+
*Non breaking changes:*
|
|
25
|
+
|
|
26
|
+
* (Paul Sadauskas) Add support for --stdin-filename
|
|
27
|
+
* (mvz) Generate versioned documentation links
|
|
28
|
+
* (mvz) Bugfix: Only report FeatureEnvy for instance methods
|
|
29
|
+
* (troessner) List all smells
|
|
30
|
+
|
|
31
|
+
## 4.8.2 (2018-06-26)
|
|
32
|
+
|
|
33
|
+
* (mvz) Only report FeatureEnvy for instance methods
|
|
34
|
+
* (mvz) Generate versioned documentation links
|
|
35
|
+
|
|
36
|
+
## 4.8.1 (2018-04-12)
|
|
37
|
+
|
|
38
|
+
* (mvz) Loosen dependency on rainbow
|
|
39
|
+
|
|
40
|
+
## 4.8.0 (2018-03-05)
|
|
41
|
+
|
|
42
|
+
* (pocke) Support Ruby 2.5
|
|
43
|
+
* (mvz) Print original exception class in certain error messages
|
|
44
|
+
* (mvz) Only include long exception message in CLI output
|
|
45
|
+
* (chastell) Add official support for Ruby 2.5
|
|
46
|
+
* (mvz) Do not detect ModuleInitialize for nested dynamic classes
|
|
47
|
+
|
|
48
|
+
## 4.7.3 (2017-11-05)
|
|
49
|
+
|
|
50
|
+
* (mvz) Handle UTF-8 files in all locales
|
|
51
|
+
* (troessner) Handle encoding and other errors when parsing the source
|
|
52
|
+
* (mvz) Report method source line in PrimaDonnaMethod
|
|
53
|
+
* (mvz) Pick up config file in reek matcher
|
|
54
|
+
* (mvz) Let REEK_SRC override set values in rake task
|
|
55
|
+
|
|
56
|
+
## 4.7.2 (2017-07-24)
|
|
57
|
+
|
|
58
|
+
* (mvz) Also report unused uncommunicative parameter names
|
|
59
|
+
* (mvz) Track visibility correctly when using method definition visibility modifiers
|
|
60
|
+
* (mvz) Handle method comments when using method definition visibility modifiers
|
|
61
|
+
|
|
62
|
+
## 4.7.1 (2017-06-12)
|
|
63
|
+
|
|
64
|
+
* (mvz) Improve IrresponsibleModule and fix some bugs along
|
|
65
|
+
|
|
66
|
+
## 4.7.0 (2017-05-31)
|
|
67
|
+
|
|
68
|
+
* (pocke) Introduce Syntax smell detector
|
|
69
|
+
|
|
70
|
+
## 4.6.2 (2017-04-27)
|
|
71
|
+
|
|
72
|
+
* (pocke) Prevent from breaking on a string with escape sequence incompatible with UTF-8
|
|
73
|
+
* (pocke) Use Ruby 2.4 parser for parsing code
|
|
74
|
+
|
|
75
|
+
## 4.6.1 (2017-04-05)
|
|
76
|
+
|
|
77
|
+
* (IanWhitney) Properly handle absolute paths.
|
|
78
|
+
|
|
3
79
|
## 4.6.0 (2017-04-04)
|
|
4
80
|
|
|
5
81
|
* (IanWhitney) Implement `--force-exclusion` flag
|
data/CONTRIBUTING.md
CHANGED
|
@@ -111,7 +111,7 @@ regard than if it were run in a terminal.
|
|
|
111
111
|
|
|
112
112
|
#### Failing Cucumber Scenarios
|
|
113
113
|
|
|
114
|
-
If there is a failing scenario and you
|
|
114
|
+
If there is a failing scenario and you cannot figure out why it is failing,
|
|
115
115
|
just run the failing scenario: `bundle exec cucumber
|
|
116
116
|
features/failing_scenario.feature:line`. By doing so Aruba will leave its set
|
|
117
117
|
up in the `tmp/aruba` directory. You can then `cd` into this directory and run
|
data/Gemfile
CHANGED
|
@@ -8,16 +8,16 @@ group :development do
|
|
|
8
8
|
gem 'activesupport', '>= 4.2'
|
|
9
9
|
gem 'aruba', '~> 0.14.0'
|
|
10
10
|
gem 'ataru', '~> 0.2.0'
|
|
11
|
-
gem 'cucumber', '~>
|
|
12
|
-
gem '
|
|
11
|
+
gem 'cucumber', '~> 3.0'
|
|
12
|
+
gem 'factory_bot', '~> 4.0'
|
|
13
13
|
gem 'rake', '~> 12.0'
|
|
14
14
|
gem 'rspec', '~> 3.0'
|
|
15
|
-
gem 'simplecov', '~> 0.
|
|
15
|
+
gem 'simplecov', '~> 0.16.1'
|
|
16
16
|
gem 'yard', '~> 0.9.5'
|
|
17
17
|
|
|
18
18
|
if RUBY_VERSION >= '2.3'
|
|
19
|
-
gem 'rubocop', '~> 0.
|
|
20
|
-
gem 'rubocop-rspec', '~> 1.
|
|
19
|
+
gem 'rubocop', '~> 0.57.1'
|
|
20
|
+
gem 'rubocop-rspec', '~> 1.20'
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
platforms :mri do
|