reek 5.6.0 → 6.0.4
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/.github/dependabot.yml +9 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -1
- data/.rubocop_todo.yml +27 -20
- data/.simplecov +1 -0
- data/CHANGELOG.md +29 -0
- data/CONTRIBUTING.md +3 -0
- data/Dockerfile +2 -1
- data/Gemfile +14 -17
- data/README.md +11 -11
- data/bin/code_climate_reek +12 -2
- data/lib/reek.rb +1 -0
- data/lib/reek/ast/ast_node_class_map.rb +1 -1
- data/lib/reek/ast/node.rb +1 -1
- data/lib/reek/ast/sexp_extensions/arguments.rb +11 -0
- data/lib/reek/cli/options.rb +3 -3
- data/lib/reek/code_comment.rb +36 -29
- data/lib/reek/configuration/app_configuration.rb +4 -3
- data/lib/reek/configuration/configuration_converter.rb +2 -2
- data/lib/reek/configuration/directory_directives.rb +9 -3
- data/lib/reek/configuration/excluded_paths.rb +2 -1
- data/lib/reek/context/code_context.rb +1 -1
- data/lib/reek/context/module_context.rb +3 -1
- data/lib/reek/context/refinement_context.rb +16 -0
- data/lib/reek/context_builder.rb +16 -2
- data/lib/reek/errors/legacy_comment_separator_error.rb +36 -0
- data/lib/reek/report.rb +5 -7
- data/lib/reek/report/code_climate/code_climate_configuration.yml +1 -1
- data/lib/reek/report/code_climate/code_climate_formatter.rb +1 -3
- data/lib/reek/report/code_climate/code_climate_report.rb +2 -1
- data/lib/reek/report/simple_warning_formatter.rb +0 -7
- data/lib/reek/smell_detectors/base_detector.rb +2 -10
- data/lib/reek/smell_detectors/boolean_parameter.rb +3 -1
- data/lib/reek/smell_detectors/data_clump.rb +23 -56
- data/lib/reek/smell_detectors/nil_check.rb +1 -12
- data/lib/reek/smell_detectors/uncommunicative_variable_name.rb +1 -1
- data/lib/reek/smell_warning.rb +2 -3
- data/lib/reek/source/source_locator.rb +14 -13
- data/lib/reek/spec/smell_matcher.rb +2 -1
- data/lib/reek/version.rb +1 -1
- data/reek.gemspec +17 -7
- metadata +23 -246
- data/.travis.yml +0 -35
- data/docs/API.md +0 -174
- data/docs/Attribute.md +0 -39
- data/docs/Basic-Smell-Options.md +0 -85
- data/docs/Boolean-Parameter.md +0 -54
- data/docs/Class-Variable.md +0 -40
- data/docs/Code-Smells.md +0 -39
- data/docs/Command-Line-Options.md +0 -119
- data/docs/Control-Couple.md +0 -26
- data/docs/Control-Parameter.md +0 -32
- data/docs/Data-Clump.md +0 -46
- data/docs/Duplicate-Method-Call.md +0 -264
- data/docs/Feature-Envy.md +0 -93
- data/docs/How-To-Write-New-Detectors.md +0 -132
- data/docs/How-reek-works-internally.md +0 -114
- data/docs/Instance-Variable-Assumption.md +0 -163
- data/docs/Irresponsible-Module.md +0 -47
- data/docs/Large-Class.md +0 -16
- data/docs/Long-Parameter-List.md +0 -39
- data/docs/Long-Yield-List.md +0 -37
- data/docs/Manual-Dispatch.md +0 -30
- data/docs/Missing-Safe-Method.md +0 -92
- data/docs/Module-Initialize.md +0 -62
- data/docs/Nested-Iterators.md +0 -59
- data/docs/Nil-Check.md +0 -44
- data/docs/RSpec-matchers.md +0 -129
- data/docs/Rake-Task.md +0 -66
- data/docs/Reek-4-to-Reek-5-migration.md +0 -188
- data/docs/Reek-Driven-Development.md +0 -46
- data/docs/Repeated-Conditional.md +0 -47
- data/docs/Simulated-Polymorphism.md +0 -16
- data/docs/Smell-Suppression.md +0 -96
- data/docs/Style-Guide.md +0 -19
- data/docs/Subclassed-From-Core-Class.md +0 -79
- data/docs/Too-Many-Constants.md +0 -37
- data/docs/Too-Many-Instance-Variables.md +0 -43
- data/docs/Too-Many-Methods.md +0 -56
- data/docs/Too-Many-Statements.md +0 -54
- data/docs/Uncommunicative-Method-Name.md +0 -94
- data/docs/Uncommunicative-Module-Name.md +0 -92
- data/docs/Uncommunicative-Name.md +0 -18
- data/docs/Uncommunicative-Parameter-Name.md +0 -90
- data/docs/Uncommunicative-Variable-Name.md +0 -96
- data/docs/Unused-Parameters.md +0 -28
- data/docs/Unused-Private-Method.md +0 -101
- data/docs/Utility-Function.md +0 -56
- data/docs/Versioning-Policy.md +0 -7
- data/docs/YAML-Reports.md +0 -93
- data/docs/defaults.reek.yml +0 -129
- data/docs/templates/default/docstring/html/public_api_marker.erb +0 -3
- data/docs/templates/default/docstring/setup.rb +0 -37
- data/docs/templates/default/fulldoc/html/css/common.css +0 -1
- data/docs/yard_plugin.rb +0 -17
- data/features/command_line_interface/basic_usage.feature +0 -15
- data/features/command_line_interface/options.feature +0 -124
- data/features/command_line_interface/show_progress.feature +0 -33
- data/features/command_line_interface/smell_selection.feature +0 -15
- data/features/command_line_interface/smells_count.feature +0 -38
- data/features/command_line_interface/stdin.feature +0 -65
- data/features/configuration_files/accept_setting.feature +0 -87
- data/features/configuration_files/directory_specific_directives.feature +0 -274
- data/features/configuration_files/exclude_directives.feature +0 -35
- data/features/configuration_files/exclude_paths_directives.feature +0 -42
- data/features/configuration_files/masking_smells.feature +0 -94
- data/features/configuration_files/mix_accept_reject_setting.feature +0 -84
- data/features/configuration_files/reject_setting.feature +0 -89
- data/features/configuration_files/schema_validation.feature +0 -59
- data/features/configuration_files/show_configuration_file.feature +0 -44
- data/features/configuration_files/unused_private_method.feature +0 -68
- data/features/configuration_loading.feature +0 -91
- data/features/configuration_via_source_comments/erroneous_source_comments.feature +0 -68
- data/features/configuration_via_source_comments/well_formed_source_comments.feature +0 -116
- data/features/locales.feature +0 -32
- data/features/programmatic_access.feature +0 -41
- data/features/rake_task/rake_task.feature +0 -138
- data/features/reports/codeclimate.feature +0 -59
- data/features/reports/json.feature +0 -59
- data/features/reports/reports.feature +0 -219
- data/features/reports/yaml.feature +0 -52
- data/features/rspec_matcher.feature +0 -41
- data/features/samples.feature +0 -305
- data/features/step_definitions/.rubocop.yml +0 -5
- data/features/step_definitions/reek_steps.rb +0 -98
- data/features/step_definitions/sample_file_steps.rb +0 -63
- data/features/support/env.rb +0 -34
- data/features/todo_list.feature +0 -108
- data/samples/checkstyle.xml +0 -7
- data/samples/clean_source/clean.rb +0 -6
- data/samples/configuration/accepts_rejects_and_excludes_for_detectors.reek.yml +0 -29
- data/samples/configuration/accepts_rejects_and_excludes_for_directory_directives.reek.yml +0 -30
- data/samples/configuration/corrupt.reek +0 -1
- data/samples/configuration/empty.reek +0 -0
- data/samples/configuration/full_configuration.reek +0 -13
- data/samples/configuration/full_mask.reek +0 -6
- data/samples/configuration/home/home.reek.yml +0 -4
- data/samples/configuration/partial_mask.reek +0 -4
- data/samples/configuration/regular_configuration/.reek.yml +0 -4
- data/samples/configuration/regular_configuration/empty_sub_directory/.gitignore +0 -0
- data/samples/configuration/with_excluded_paths.reek +0 -5
- data/samples/no_config_file/.keep +0 -0
- data/samples/paths.rb +0 -5
- data/samples/smelly_source/inline.rb +0 -704
- data/samples/smelly_source/optparse.rb +0 -1788
- data/samples/smelly_source/redcloth.rb +0 -1130
- data/samples/smelly_source/ruby.rb +0 -368
- data/samples/smelly_source/smelly.rb +0 -7
- data/samples/source_with_exclude_paths/ignore_me/uncommunicative_method_name.rb +0 -5
- data/samples/source_with_exclude_paths/nested/ignore_me_as_well/irresponsible_module.rb +0 -2
- data/samples/source_with_exclude_paths/nested/uncommunicative_parameter_name.rb +0 -6
- data/samples/source_with_exclude_paths/nested/uncommunicative_variable_name.rb +0 -6
- data/samples/source_with_hidden_directories/.hidden/hidden.rb +0 -1
- data/samples/source_with_hidden_directories/not_hidden.rb +0 -1
- data/samples/source_with_non_ruby_files/gibberish +0 -1
- data/samples/source_with_non_ruby_files/python_source.py +0 -1
- data/samples/source_with_non_ruby_files/ruby.rb +0 -6
- data/spec/factories/factories.rb +0 -37
- data/spec/performance/reek/smell_detectors/runtime_speed_spec.rb +0 -17
- data/spec/quality/documentation_spec.rb +0 -40
- data/spec/quality/reek_source_spec.rb +0 -11
- data/spec/reek/ast/node_spec.rb +0 -211
- data/spec/reek/ast/object_refs_spec.rb +0 -83
- data/spec/reek/ast/reference_collector_spec.rb +0 -47
- data/spec/reek/ast/sexp_extensions_spec.rb +0 -516
- data/spec/reek/cli/application_spec.rb +0 -168
- data/spec/reek/cli/command/report_command_spec.rb +0 -44
- data/spec/reek/cli/command/todo_list_command_spec.rb +0 -86
- data/spec/reek/cli/options_spec.rb +0 -51
- data/spec/reek/cli/silencer_spec.rb +0 -28
- data/spec/reek/code_comment_spec.rb +0 -185
- data/spec/reek/configuration/app_configuration_spec.rb +0 -195
- data/spec/reek/configuration/configuration_file_finder_spec.rb +0 -230
- data/spec/reek/configuration/default_directive_spec.rb +0 -13
- data/spec/reek/configuration/directory_directives_spec.rb +0 -116
- data/spec/reek/configuration/excluded_paths_spec.rb +0 -16
- data/spec/reek/configuration/rake_task_converter_spec.rb +0 -33
- data/spec/reek/configuration/schema_validator_spec.rb +0 -165
- data/spec/reek/context/code_context_spec.rb +0 -192
- data/spec/reek/context/ghost_context_spec.rb +0 -60
- data/spec/reek/context/method_context_spec.rb +0 -72
- data/spec/reek/context/module_context_spec.rb +0 -55
- data/spec/reek/context/root_context_spec.rb +0 -12
- data/spec/reek/context/statement_counter_spec.rb +0 -24
- data/spec/reek/context_builder_spec.rb +0 -460
- data/spec/reek/detector_repository_spec.rb +0 -22
- data/spec/reek/documentation_link_spec.rb +0 -20
- data/spec/reek/errors/base_error_spec.rb +0 -13
- data/spec/reek/examiner_spec.rb +0 -309
- data/spec/reek/logging_error_handler_spec.rb +0 -24
- data/spec/reek/rake/task_spec.rb +0 -56
- data/spec/reek/report/code_climate/code_climate_configuration_spec.rb +0 -24
- data/spec/reek/report/code_climate/code_climate_fingerprint_spec.rb +0 -126
- data/spec/reek/report/code_climate/code_climate_formatter_spec.rb +0 -51
- data/spec/reek/report/code_climate/code_climate_report_spec.rb +0 -56
- data/spec/reek/report/html_report_spec.rb +0 -19
- data/spec/reek/report/json_report_spec.rb +0 -58
- data/spec/reek/report/location_formatter_spec.rb +0 -32
- data/spec/reek/report/progress_formatter_spec.rb +0 -68
- data/spec/reek/report/text_report_spec.rb +0 -89
- data/spec/reek/report/xml_report_spec.rb +0 -24
- data/spec/reek/report/yaml_report_spec.rb +0 -55
- data/spec/reek/report_spec.rb +0 -28
- data/spec/reek/smell_configuration_spec.rb +0 -56
- data/spec/reek/smell_detectors/attribute_spec.rb +0 -197
- data/spec/reek/smell_detectors/base_detector_spec.rb +0 -60
- data/spec/reek/smell_detectors/boolean_parameter_spec.rb +0 -93
- data/spec/reek/smell_detectors/class_variable_spec.rb +0 -106
- data/spec/reek/smell_detectors/control_parameter_spec.rb +0 -300
- data/spec/reek/smell_detectors/data_clump_spec.rb +0 -120
- data/spec/reek/smell_detectors/duplicate_method_call_spec.rb +0 -211
- data/spec/reek/smell_detectors/feature_envy_spec.rb +0 -295
- data/spec/reek/smell_detectors/instance_variable_assumption_spec.rb +0 -96
- data/spec/reek/smell_detectors/irresponsible_module_spec.rb +0 -226
- data/spec/reek/smell_detectors/long_parameter_list_spec.rb +0 -61
- data/spec/reek/smell_detectors/long_yield_list_spec.rb +0 -49
- data/spec/reek/smell_detectors/manual_dispatch_spec.rb +0 -75
- data/spec/reek/smell_detectors/missing_safe_method_spec.rb +0 -62
- data/spec/reek/smell_detectors/module_initialize_spec.rb +0 -77
- data/spec/reek/smell_detectors/nested_iterators_spec.rb +0 -333
- data/spec/reek/smell_detectors/nil_check_spec.rb +0 -100
- data/spec/reek/smell_detectors/repeated_conditional_spec.rb +0 -100
- data/spec/reek/smell_detectors/subclassed_from_core_class_spec.rb +0 -77
- data/spec/reek/smell_detectors/too_many_constants_spec.rb +0 -144
- data/spec/reek/smell_detectors/too_many_instance_variables_spec.rb +0 -132
- data/spec/reek/smell_detectors/too_many_methods_spec.rb +0 -54
- data/spec/reek/smell_detectors/too_many_statements_spec.rb +0 -90
- data/spec/reek/smell_detectors/uncommunicative_method_name_spec.rb +0 -78
- data/spec/reek/smell_detectors/uncommunicative_module_name_spec.rb +0 -78
- data/spec/reek/smell_detectors/uncommunicative_parameter_name_spec.rb +0 -147
- data/spec/reek/smell_detectors/uncommunicative_variable_name_spec.rb +0 -201
- data/spec/reek/smell_detectors/unused_parameters_spec.rb +0 -114
- data/spec/reek/smell_detectors/unused_private_method_spec.rb +0 -205
- data/spec/reek/smell_detectors/utility_function_spec.rb +0 -293
- data/spec/reek/smell_warning_spec.rb +0 -137
- data/spec/reek/source/source_code_spec.rb +0 -66
- data/spec/reek/source/source_locator_spec.rb +0 -166
- data/spec/reek/spec/should_reek_of_spec.rb +0 -154
- data/spec/reek/spec/should_reek_only_of_spec.rb +0 -91
- data/spec/reek/spec/should_reek_spec.rb +0 -52
- data/spec/reek/spec/smell_matcher_spec.rb +0 -87
- data/spec/reek/tree_dresser_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -96
- data/tasks/configuration.rake +0 -19
- data/tasks/console.rake +0 -5
- data/tasks/reek.rake +0 -6
- data/tasks/rubocop.rake +0 -11
- data/tasks/test.rake +0 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d0bbc58b8f9e593e64fd19b18b70cb63f776cbb69dba486b94ff7c53d449683
|
|
4
|
+
data.tar.gz: d7773c82aebfc8cf43cad4d6158fb977e3a84d1a02d87356b86f0b7abb017b8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36f145207e147be9793009f9db478086267298aff71b3ef35235c80235c3f2d1d9d66737bfb6b2f91b254cb20319ddec63c19012744f654ebe3f492a4c728019
|
|
7
|
+
data.tar.gz: 00a48adb00260ae7b48e8616b96c2ec1f08e20fe34594922213aa668cc3eabce37a0814eb53a5abb41546e6877c1baa1d1245b695306d8dbd81851ddb4655761
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and
|
|
2
|
+
# run tests with Rake
|
|
3
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
4
|
+
|
|
5
|
+
name: Ruby
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [ master ]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [ master ]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
ruby: [2.4, 2.5, 2.6, 2.7, jruby-9.2]
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v2
|
|
24
|
+
- name: Set up Ruby
|
|
25
|
+
uses: ruby/setup-ruby@v1
|
|
26
|
+
with:
|
|
27
|
+
ruby-version: ${{ matrix.ruby }}
|
|
28
|
+
bundler-cache: true
|
|
29
|
+
- name: Run specs
|
|
30
|
+
run: bundle exec rake test:spec
|
|
31
|
+
- name: Run performance tests
|
|
32
|
+
run: bundle exec rake test:performance
|
|
33
|
+
- name: Update default configuration
|
|
34
|
+
run: bundle exec rake configuration:update_default_configuration
|
|
35
|
+
- name: Run cucumber features
|
|
36
|
+
run: bundle exec rake test:features
|
|
37
|
+
- name: Run code quality specs
|
|
38
|
+
run: bundle exec rake test:quality
|
|
39
|
+
|
|
40
|
+
rubocop:
|
|
41
|
+
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v2
|
|
46
|
+
- name: Set up Ruby
|
|
47
|
+
uses: ruby/setup-ruby@v1
|
|
48
|
+
with:
|
|
49
|
+
ruby-version: 2.7
|
|
50
|
+
bundler-cache: true
|
|
51
|
+
- name: Run RuboCop
|
|
52
|
+
run: bundle exec rubocop -P
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -9,7 +9,8 @@ AllCops:
|
|
|
9
9
|
- 'samples/**/*'
|
|
10
10
|
- 'tmp/**/*'
|
|
11
11
|
- 'vendor/**/*'
|
|
12
|
-
|
|
12
|
+
NewCops: enable
|
|
13
|
+
TargetRubyVersion: 2.4
|
|
13
14
|
|
|
14
15
|
# Tables are nice
|
|
15
16
|
Layout/HashAlignment:
|
|
@@ -57,6 +58,7 @@ Lint/BooleanSymbol:
|
|
|
57
58
|
# Spec blocks can be any size
|
|
58
59
|
Metrics/BlockLength:
|
|
59
60
|
Exclude:
|
|
61
|
+
- '**/*.gemspec'
|
|
60
62
|
- 'spec/**/*'
|
|
61
63
|
|
|
62
64
|
# Keyword arguments make long parameter lists readable
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2021-01-03 18:17:11 UTC using RuboCop version 1.7.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 2
|
|
10
|
+
Lint/MissingSuper:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'lib/reek/rake/task.rb'
|
|
13
|
+
- 'lib/reek/smell_detectors/base_detector.rb'
|
|
14
|
+
|
|
15
|
+
# Offense count: 2
|
|
16
|
+
# Configuration parameters: IgnoredPatterns.
|
|
17
|
+
# IgnoredPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times)
|
|
18
|
+
Lint/UnreachableLoop:
|
|
19
|
+
Exclude:
|
|
20
|
+
- 'spec/reek/ast/node_spec.rb'
|
|
21
|
+
|
|
22
|
+
# Offense count: 2
|
|
23
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
|
10
24
|
Metrics/AbcSize:
|
|
11
25
|
Max: 21
|
|
12
26
|
|
|
13
27
|
# Offense count: 1
|
|
14
|
-
# Configuration parameters: CountComments.
|
|
28
|
+
# Configuration parameters: CountComments, CountAsOne.
|
|
15
29
|
Metrics/ClassLength:
|
|
16
|
-
Max:
|
|
30
|
+
Max: 170
|
|
17
31
|
|
|
18
|
-
# Offense count:
|
|
19
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
|
32
|
+
# Offense count: 13
|
|
33
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
20
34
|
Metrics/MethodLength:
|
|
21
35
|
Max: 16
|
|
22
36
|
|
|
@@ -25,17 +39,6 @@ RSpec/AnyInstance:
|
|
|
25
39
|
Exclude:
|
|
26
40
|
- 'spec/reek/cli/application_spec.rb'
|
|
27
41
|
|
|
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
42
|
# Offense count: 4
|
|
40
43
|
RSpec/MultipleDescribes:
|
|
41
44
|
Exclude:
|
|
@@ -44,12 +47,16 @@ RSpec/MultipleDescribes:
|
|
|
44
47
|
- 'spec/reek/report/location_formatter_spec.rb'
|
|
45
48
|
- 'spec/reek/report/progress_formatter_spec.rb'
|
|
46
49
|
|
|
47
|
-
# Offense count:
|
|
48
|
-
# Configuration parameters: AggregateFailuresByDefault.
|
|
50
|
+
# Offense count: 30
|
|
49
51
|
RSpec/MultipleExpectations:
|
|
50
52
|
Max: 5
|
|
51
53
|
|
|
52
|
-
# Offense count:
|
|
54
|
+
# Offense count: 16
|
|
55
|
+
# Configuration parameters: AllowSubject.
|
|
56
|
+
RSpec/MultipleMemoizedHelpers:
|
|
57
|
+
Max: 9
|
|
58
|
+
|
|
59
|
+
# Offense count: 27
|
|
53
60
|
RSpec/NestedGroups:
|
|
54
61
|
Max: 5
|
|
55
62
|
|
data/.simplecov
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
+
## 6.0.4 (2021-04-27)
|
|
4
|
+
|
|
5
|
+
* (Nicolas Ferrari) Add build-base to Dockerfile
|
|
6
|
+
* (Masataka Pocke Kuwabara and Daniel Santos Dantas) Reduce gem package size
|
|
7
|
+
|
|
8
|
+
## 6.0.3 (2021-01-11)
|
|
9
|
+
|
|
10
|
+
* (mvz) Require parser 3.0
|
|
11
|
+
* (mvz) In a refinement, assign smells to the refined module or class
|
|
12
|
+
|
|
13
|
+
## 6.0.2 (2020-10-17)
|
|
14
|
+
|
|
15
|
+
* (mvz) Loosen dependency on psych. This should resolve installation problems on
|
|
16
|
+
mingw32
|
|
17
|
+
* (Cesario Uy) Fix typo in docs for "Boolean Parameter" smell
|
|
18
|
+
* (mvz) Set link metadata in gemspec
|
|
19
|
+
|
|
20
|
+
## 6.0.1 (2020-05-26)
|
|
21
|
+
|
|
22
|
+
* (Maxim Pertsov) Handle absolute paths for directories correctly
|
|
23
|
+
|
|
24
|
+
## 6.0.0 (2020-03-30)
|
|
25
|
+
|
|
26
|
+
* (mvz) Make codeclimate-engine-rb a development dependency
|
|
27
|
+
* (mvz) Drop support for Ruby 2.3
|
|
28
|
+
* (mvz) Raise error when legacy code comment format is used
|
|
29
|
+
* (mvz) Stop reporting NilCheck for safe navigation
|
|
30
|
+
* (likeath) Properly handle "Forward all" syntax
|
|
31
|
+
|
|
3
32
|
## 5.6.0 (2020-01-20)
|
|
4
33
|
|
|
5
34
|
* (mvz) Support Ruby 2.7
|
data/CONTRIBUTING.md
CHANGED
|
@@ -27,6 +27,9 @@ version, Ruby platform (MRI, JRuby, etc.), operating system.
|
|
|
27
27
|
Try to provide a minimal example that reproduces the issue.
|
|
28
28
|
Extra kudos if you can write it as a failing test. :)
|
|
29
29
|
|
|
30
|
+
Make sure any code examples and output are properly formatted
|
|
31
|
+
using [code blocks](https://github.github.com/gfm/#fenced-code-blocks).
|
|
32
|
+
|
|
30
33
|
## Contributing features, bugfixes, documentation
|
|
31
34
|
|
|
32
35
|
### Getting started
|
data/Dockerfile
CHANGED
|
@@ -11,7 +11,7 @@ ENV code_dir /code
|
|
|
11
11
|
ENV app_dir /usr/src/app
|
|
12
12
|
ENV user app
|
|
13
13
|
|
|
14
|
-
RUN apk --update add git
|
|
14
|
+
RUN apk --update add git build-base
|
|
15
15
|
ADD . ${app_dir}
|
|
16
16
|
|
|
17
17
|
RUN adduser -u 9000 -D ${user}
|
|
@@ -22,6 +22,7 @@ WORKDIR ${app_dir}
|
|
|
22
22
|
|
|
23
23
|
RUN gem install rake
|
|
24
24
|
RUN bundle install --without debugging development
|
|
25
|
+
RUN gem install codeclimate-engine-rb
|
|
25
26
|
|
|
26
27
|
VOLUME ${code_dir}
|
|
27
28
|
WORKDIR ${code_dir}
|
data/Gemfile
CHANGED
|
@@ -5,19 +5,19 @@ gemspec
|
|
|
5
5
|
ruby RUBY_VERSION
|
|
6
6
|
|
|
7
7
|
group :development do
|
|
8
|
-
gem 'aruba',
|
|
9
|
-
gem '
|
|
10
|
-
gem '
|
|
11
|
-
gem 'kramdown',
|
|
12
|
-
gem 'kramdown-parser-gfm',
|
|
13
|
-
gem 'rake',
|
|
14
|
-
gem 'rspec',
|
|
15
|
-
gem 'rspec-benchmark',
|
|
16
|
-
gem 'rubocop',
|
|
17
|
-
gem 'rubocop-performance',
|
|
18
|
-
gem 'rubocop-rspec',
|
|
19
|
-
gem 'simplecov',
|
|
20
|
-
gem 'yard',
|
|
8
|
+
gem 'aruba', '~> 1.0'
|
|
9
|
+
gem 'codeclimate-engine-rb', '~> 0.4.0'
|
|
10
|
+
gem 'cucumber', ['>= 4.0', '< 7.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.6.0'
|
|
16
|
+
gem 'rubocop', '~> 1.12.0'
|
|
17
|
+
gem 'rubocop-performance', '~> 1.10.1'
|
|
18
|
+
gem 'rubocop-rspec', '~> 2.2.0'
|
|
19
|
+
gem 'simplecov', ['>= 0.18.0', '< 0.22.0']
|
|
20
|
+
gem 'yard', '~> 0.9.5'
|
|
21
21
|
|
|
22
22
|
platforms :mri do
|
|
23
23
|
gem 'redcarpet', '~> 3.4'
|
|
@@ -25,8 +25,5 @@ group :development do
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
group :debugging do
|
|
28
|
-
gem 'pry'
|
|
29
|
-
platforms :mri do
|
|
30
|
-
gem 'pry-byebug'
|
|
31
|
-
end
|
|
28
|
+
gem 'pry', '~> 0.14.0'
|
|
32
29
|
end
|
data/README.md
CHANGED
|
@@ -45,12 +45,6 @@
|
|
|
45
45
|
* 
|
|
46
46
|
* 
|
|
47
47
|
|
|
48
|
-
## Reek 5 is out!
|
|
49
|
-
|
|
50
|
-
Reek 5 is out and with it a bunch of breaking changes. If you're a new user you can just
|
|
51
|
-
continue with the quickstart below. If you're a Reek 4 user and would like to upgrade to 5, don't
|
|
52
|
-
worry, this shouldn't take you more than 10 minutes. Check out our [Upgrade Guide](docs/Reek-4-to-Reek-5-migration.md).
|
|
53
|
-
|
|
54
48
|
## Quickstart
|
|
55
49
|
|
|
56
50
|
Reek is a tool that examines Ruby classes, modules and methods and reports any
|
|
@@ -100,7 +94,7 @@ demo.rb -- 2 warnings:
|
|
|
100
94
|
|
|
101
95
|
## Supported Ruby versions
|
|
102
96
|
|
|
103
|
-
Reek is officially supported for CRuby 2.
|
|
97
|
+
Reek is officially supported for CRuby 2.4 to 2.7 and for JRuby 9.2.
|
|
104
98
|
Other Ruby implementations (like Rubinius) are not officially supported but
|
|
105
99
|
should work as well.
|
|
106
100
|
|
|
@@ -292,7 +286,7 @@ detectors:
|
|
|
292
286
|
# You can disable smells completely
|
|
293
287
|
IrresponsibleModule:
|
|
294
288
|
enabled: false
|
|
295
|
-
|
|
289
|
+
|
|
296
290
|
# You can use filters to silence Reek warnings.
|
|
297
291
|
# Either because you simply disagree with Reek (we are not the police) or
|
|
298
292
|
# because you want to fix this at a later point in time.
|
|
@@ -300,7 +294,7 @@ detectors:
|
|
|
300
294
|
exclude:
|
|
301
295
|
- "MyWorker#self.class_method" # should be refactored
|
|
302
296
|
- "AnotherWorker#instance_method" # should be refactored as well
|
|
303
|
-
|
|
297
|
+
|
|
304
298
|
# A lot of smells allow fine tuning their configuration. You can look up all available options
|
|
305
299
|
# in the corresponding smell documentation in /docs. In most cases you probably can just go
|
|
306
300
|
# with the defaults as documented in defaults.reek.yml.
|
|
@@ -355,9 +349,14 @@ This configuration for instance:
|
|
|
355
349
|
detectors:
|
|
356
350
|
IrresponsibleModule:
|
|
357
351
|
enabled: false
|
|
358
|
-
|
|
352
|
+
|
|
359
353
|
TooManyStatements:
|
|
360
354
|
max_statements: 5
|
|
355
|
+
|
|
356
|
+
directories:
|
|
357
|
+
"app/controllers":
|
|
358
|
+
TooManyStatements:
|
|
359
|
+
max_statements: 10
|
|
361
360
|
```
|
|
362
361
|
|
|
363
362
|
translates to:
|
|
@@ -374,7 +373,7 @@ are documented in the corresponding smell type /docs page (if you want to get a
|
|
|
374
373
|
configurations you can also check out [the `defaults.reek.yml` file in this repository](docs/defaults.reek.yml).
|
|
375
374
|
|
|
376
375
|
Note that you do not need a configuration file at all.
|
|
377
|
-
If you're fine with all the [defaults
|
|
376
|
+
If you're fine with all the [defaults](docs/defaults.reek.yml) we set you can skip this completely.
|
|
378
377
|
|
|
379
378
|
Don't worry about introducing a mistake in your configuration file that might go unnoticed - Reek uses a
|
|
380
379
|
schema to validate your configuration against on start up and will faily loudly in case you
|
|
@@ -613,6 +612,7 @@ Be careful though, Reek does not merge your configuration entries, so if you alr
|
|
|
613
612
|
Reek
|
|
614
613
|
* [ruby-critic](https://github.com/whitesmith/rubycritic) - gem that wraps around static analysis gems such as Reek, [flay](https://github.com/seattlerb/flay) and [flog](https://github.com/seattlerb/flog)
|
|
615
614
|
* [pronto-reek](https://github.com/mmozuras/pronto-reek) - Reek integration for [pronto](https://github.com/mmozuras/pronto)
|
|
615
|
+
* [action-reek](https://github.com/reviewdog/action-reek) - GitHub Action to run reek with [reviewdog](https://github.com/reviewdog/reviewdog) 🐶
|
|
616
616
|
|
|
617
617
|
### Misc
|
|
618
618
|
|
data/bin/code_climate_reek
CHANGED
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
require_relative '../lib/reek'
|
|
8
8
|
require_relative '../lib/reek/cli/application'
|
|
9
|
+
require_relative '../lib/reek/report/code_climate'
|
|
9
10
|
|
|
10
11
|
# Map input coming from CodeClimate to Reek.
|
|
11
12
|
class CodeClimateToReek
|
|
12
13
|
# Following the spec (https://github.com/codeclimate/spec/blob/master/SPEC.md)
|
|
13
14
|
# we have to exit with a zero for both failure and success.
|
|
14
15
|
ENGINE_CONFIGURATION = [
|
|
15
|
-
'-f', 'code_climate',
|
|
16
16
|
'--failure-exit-code', '0',
|
|
17
|
-
'--success-exit-code', '0'
|
|
17
|
+
'--success-exit-code', '0',
|
|
18
|
+
'.'
|
|
18
19
|
].freeze
|
|
19
20
|
|
|
20
21
|
attr_reader :configuration_file_path, :include_paths_key, :include_paths_default
|
|
@@ -54,6 +55,15 @@ class CodeClimateToReek
|
|
|
54
55
|
end
|
|
55
56
|
end
|
|
56
57
|
|
|
58
|
+
# Override for ReportCommand to force the use of CodeClimateReport.
|
|
59
|
+
module ReportClassOverride
|
|
60
|
+
def report_class
|
|
61
|
+
Reek::Report::CodeClimateReport
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
Reek::CLI::Command::ReportCommand.prepend ReportClassOverride
|
|
66
|
+
|
|
57
67
|
application = Reek::CLI::Application.new(CodeClimateToReek.new.cli_arguments)
|
|
58
68
|
|
|
59
69
|
exit application.execute
|
data/lib/reek.rb
CHANGED
|
@@ -8,6 +8,7 @@ require_relative 'reek/examiner'
|
|
|
8
8
|
require_relative 'reek/report'
|
|
9
9
|
|
|
10
10
|
module Reek
|
|
11
|
+
DEFAULT_SMELL_CONFIGURATION = File.join(__dir__, '../docs/defaults.reek.yml').freeze
|
|
11
12
|
DEFAULT_CONFIGURATION_FILE_NAME = '.reek.yml'
|
|
12
13
|
DETECTORS_KEY = 'detectors'
|
|
13
14
|
EXCLUDE_PATHS_KEY = 'exclude_paths'
|
data/lib/reek/ast/node.rb
CHANGED
|
@@ -60,7 +60,7 @@ module Reek
|
|
|
60
60
|
#
|
|
61
61
|
# Returns an array with all matching nodes.
|
|
62
62
|
def each_node(target_types, ignoring = [], &blk)
|
|
63
|
-
return enum_for(:each_node, target_types, ignoring) unless
|
|
63
|
+
return enum_for(:each_node, target_types, ignoring) unless blk
|
|
64
64
|
|
|
65
65
|
look_for(Array(target_types), ignoring, &blk)
|
|
66
66
|
end
|
|
@@ -93,6 +93,17 @@ module Reek
|
|
|
93
93
|
module ShadowargNode
|
|
94
94
|
include ArgNodeBase
|
|
95
95
|
end
|
|
96
|
+
|
|
97
|
+
# Utility methods for :forward_args nodes.
|
|
98
|
+
# rubocop:disable Naming/ClassAndModuleCamelCase
|
|
99
|
+
module Forward_ArgsNode
|
|
100
|
+
include ArgNodeBase
|
|
101
|
+
|
|
102
|
+
def anonymous_splat?
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
# rubocop:enable Naming/ClassAndModuleCamelCase
|
|
96
107
|
end
|
|
97
108
|
end
|
|
98
109
|
end
|