mutest 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/hooks/pre-command +3 -0
- data/.buildkite/pipeline.yml +51 -0
- data/.gitattributes +1 -0
- data/.gitignore +38 -0
- data/.rspec +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +216 -0
- data/Gemfile.shared +3 -0
- data/LICENSE +21 -0
- data/README.md +8 -0
- data/Rakefile +24 -0
- data/bin/mutest +39 -0
- data/build/Dockerfile +71 -0
- data/build/docker-bootstrap.sh +85 -0
- data/build/docker-exec +29 -0
- data/build/make-docker +3 -0
- data/build/ruby_matrix +1 -0
- data/build/run +5 -0
- data/build/strict-mode.sh +16 -0
- data/circle.yml +7 -0
- data/config/devtools.yml +2 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/reek.yml +137 -0
- data/config/rubocop.yml +395 -0
- data/config/triage.yml +2 -0
- data/config/yardstick.yml +2 -0
- data/lib/mutest.rb +243 -0
- data/lib/mutest/actor.rb +52 -0
- data/lib/mutest/actor/env.rb +28 -0
- data/lib/mutest/actor/mailbox.rb +31 -0
- data/lib/mutest/actor/receiver.rb +39 -0
- data/lib/mutest/actor/sender.rb +22 -0
- data/lib/mutest/ast.rb +44 -0
- data/lib/mutest/ast/meta.rb +7 -0
- data/lib/mutest/ast/meta/const.rb +22 -0
- data/lib/mutest/ast/meta/optarg.rb +24 -0
- data/lib/mutest/ast/meta/resbody.rb +15 -0
- data/lib/mutest/ast/meta/restarg.rb +15 -0
- data/lib/mutest/ast/meta/send.rb +89 -0
- data/lib/mutest/ast/meta/symbol.rb +15 -0
- data/lib/mutest/ast/named_children.rb +86 -0
- data/lib/mutest/ast/node_predicates.rb +17 -0
- data/lib/mutest/ast/nodes.rb +22 -0
- data/lib/mutest/ast/regexp.rb +50 -0
- data/lib/mutest/ast/regexp/transformer.rb +184 -0
- data/lib/mutest/ast/regexp/transformer/alternative.rb +39 -0
- data/lib/mutest/ast/regexp/transformer/character_set.rb +46 -0
- data/lib/mutest/ast/regexp/transformer/direct.rb +101 -0
- data/lib/mutest/ast/regexp/transformer/options_group.rb +65 -0
- data/lib/mutest/ast/regexp/transformer/quantifier.rb +112 -0
- data/lib/mutest/ast/regexp/transformer/recursive.rb +50 -0
- data/lib/mutest/ast/regexp/transformer/root.rb +28 -0
- data/lib/mutest/ast/regexp/transformer/text.rb +55 -0
- data/lib/mutest/ast/sexp.rb +26 -0
- data/lib/mutest/ast/types.rb +140 -0
- data/lib/mutest/cli.rb +196 -0
- data/lib/mutest/color.rb +39 -0
- data/lib/mutest/config.rb +28 -0
- data/lib/mutest/context.rb +98 -0
- data/lib/mutest/diff.rb +111 -0
- data/lib/mutest/env.rb +59 -0
- data/lib/mutest/env/bootstrap.rb +159 -0
- data/lib/mutest/expression.rb +55 -0
- data/lib/mutest/expression/method.rb +54 -0
- data/lib/mutest/expression/methods.rb +58 -0
- data/lib/mutest/expression/namespace.rb +75 -0
- data/lib/mutest/expression/parser.rb +64 -0
- data/lib/mutest/integration.rb +75 -0
- data/lib/mutest/isolation.rb +11 -0
- data/lib/mutest/isolation/fork.rb +72 -0
- data/lib/mutest/isolation/none.rb +23 -0
- data/lib/mutest/loader.rb +27 -0
- data/lib/mutest/matcher.rb +14 -0
- data/lib/mutest/matcher/chain.rb +19 -0
- data/lib/mutest/matcher/compiler.rb +55 -0
- data/lib/mutest/matcher/config.rb +81 -0
- data/lib/mutest/matcher/filter.rb +19 -0
- data/lib/mutest/matcher/method.rb +138 -0
- data/lib/mutest/matcher/method/instance.rb +63 -0
- data/lib/mutest/matcher/method/singleton.rb +88 -0
- data/lib/mutest/matcher/methods.rb +109 -0
- data/lib/mutest/matcher/namespace.rb +41 -0
- data/lib/mutest/matcher/null.rb +17 -0
- data/lib/mutest/matcher/scope.rb +38 -0
- data/lib/mutest/matcher/static.rb +15 -0
- data/lib/mutest/meta.rb +33 -0
- data/lib/mutest/meta/example.rb +32 -0
- data/lib/mutest/meta/example/dsl.rb +107 -0
- data/lib/mutest/meta/example/verification.rb +85 -0
- data/lib/mutest/mutation.rb +101 -0
- data/lib/mutest/mutator.rb +117 -0
- data/lib/mutest/mutator/node.rb +166 -0
- data/lib/mutest/mutator/node/and_asgn.rb +25 -0
- data/lib/mutest/mutator/node/argument.rb +68 -0
- data/lib/mutest/mutator/node/arguments.rb +90 -0
- data/lib/mutest/mutator/node/begin.rb +21 -0
- data/lib/mutest/mutator/node/binary.rb +64 -0
- data/lib/mutest/mutator/node/block.rb +51 -0
- data/lib/mutest/mutator/node/break.rb +21 -0
- data/lib/mutest/mutator/node/case.rb +47 -0
- data/lib/mutest/mutator/node/class.rb +21 -0
- data/lib/mutest/mutator/node/conditional_loop.rb +25 -0
- data/lib/mutest/mutator/node/const.rb +23 -0
- data/lib/mutest/mutator/node/define.rb +79 -0
- data/lib/mutest/mutator/node/defined.rb +24 -0
- data/lib/mutest/mutator/node/dstr.rb +20 -0
- data/lib/mutest/mutator/node/dsym.rb +20 -0
- data/lib/mutest/mutator/node/generic.rb +77 -0
- data/lib/mutest/mutator/node/if.rb +57 -0
- data/lib/mutest/mutator/node/kwbegin.rb +20 -0
- data/lib/mutest/mutator/node/literal.rb +19 -0
- data/lib/mutest/mutator/node/literal/array.rb +37 -0
- data/lib/mutest/mutator/node/literal/boolean.rb +27 -0
- data/lib/mutest/mutator/node/literal/fixnum.rb +36 -0
- data/lib/mutest/mutator/node/literal/float.rb +45 -0
- data/lib/mutest/mutator/node/literal/hash.rb +52 -0
- data/lib/mutest/mutator/node/literal/nil.rb +20 -0
- data/lib/mutest/mutator/node/literal/range.rb +38 -0
- data/lib/mutest/mutator/node/literal/regex.rb +76 -0
- data/lib/mutest/mutator/node/literal/string.rb +21 -0
- data/lib/mutest/mutator/node/literal/symbol.rb +26 -0
- data/lib/mutest/mutator/node/masgn.rb +21 -0
- data/lib/mutest/mutator/node/match_current_line.rb +22 -0
- data/lib/mutest/mutator/node/mlhs.rb +21 -0
- data/lib/mutest/mutator/node/named_value/access.rb +54 -0
- data/lib/mutest/mutator/node/named_value/constant_assignment.rb +42 -0
- data/lib/mutest/mutator/node/named_value/variable_assignment.rb +47 -0
- data/lib/mutest/mutator/node/next.rb +22 -0
- data/lib/mutest/mutator/node/noop.rb +19 -0
- data/lib/mutest/mutator/node/nthref.rb +22 -0
- data/lib/mutest/mutator/node/op_asgn.rb +50 -0
- data/lib/mutest/mutator/node/or_asgn.rb +26 -0
- data/lib/mutest/mutator/node/regexp.rb +33 -0
- data/lib/mutest/mutator/node/regexp/alternation_meta.rb +21 -0
- data/lib/mutest/mutator/node/regexp/capture_group.rb +26 -0
- data/lib/mutest/mutator/node/regexp/character_type.rb +29 -0
- data/lib/mutest/mutator/node/regexp/end_of_line_anchor.rb +21 -0
- data/lib/mutest/mutator/node/regexp/end_of_string_or_before_end_of_line_anchor.rb +21 -0
- data/lib/mutest/mutator/node/regexp/one_or_more.rb +29 -0
- data/lib/mutest/mutator/node/regexp/zero_or_more.rb +29 -0
- data/lib/mutest/mutator/node/regopt.rb +28 -0
- data/lib/mutest/mutator/node/resbody.rb +34 -0
- data/lib/mutest/mutator/node/rescue.rb +69 -0
- data/lib/mutest/mutator/node/return.rb +24 -0
- data/lib/mutest/mutator/node/send.rb +270 -0
- data/lib/mutest/mutator/node/send/attribute_assignment.rb +39 -0
- data/lib/mutest/mutator/node/send/binary.rb +45 -0
- data/lib/mutest/mutator/node/send/conditional.rb +21 -0
- data/lib/mutest/mutator/node/send/index.rb +47 -0
- data/lib/mutest/mutator/node/splat.rb +23 -0
- data/lib/mutest/mutator/node/super.rb +24 -0
- data/lib/mutest/mutator/node/when.rb +60 -0
- data/lib/mutest/mutator/node/yield.rb +21 -0
- data/lib/mutest/mutator/node/zsuper.rb +20 -0
- data/lib/mutest/mutator/util.rb +11 -0
- data/lib/mutest/mutator/util/array.rb +42 -0
- data/lib/mutest/mutator/util/symbol.rb +19 -0
- data/lib/mutest/parallel.rb +89 -0
- data/lib/mutest/parallel/master.rb +181 -0
- data/lib/mutest/parallel/source.rb +57 -0
- data/lib/mutest/parallel/worker.rb +76 -0
- data/lib/mutest/parser.rb +22 -0
- data/lib/mutest/registry.rb +43 -0
- data/lib/mutest/reporter.rb +39 -0
- data/lib/mutest/reporter/cli.rb +87 -0
- data/lib/mutest/reporter/cli/format.rb +135 -0
- data/lib/mutest/reporter/cli/printer.rb +124 -0
- data/lib/mutest/reporter/cli/printer/config.rb +24 -0
- data/lib/mutest/reporter/cli/printer/env_progress.rb +76 -0
- data/lib/mutest/reporter/cli/printer/env_result.rb +20 -0
- data/lib/mutest/reporter/cli/printer/mutation_progress_result.rb +31 -0
- data/lib/mutest/reporter/cli/printer/mutation_result.rb +127 -0
- data/lib/mutest/reporter/cli/printer/status.rb +49 -0
- data/lib/mutest/reporter/cli/printer/status_progressive.rb +46 -0
- data/lib/mutest/reporter/cli/printer/subject_progress.rb +65 -0
- data/lib/mutest/reporter/cli/printer/subject_result.rb +23 -0
- data/lib/mutest/reporter/cli/printer/test_result.rb +28 -0
- data/lib/mutest/reporter/cli/tput.rb +43 -0
- data/lib/mutest/reporter/null.rb +14 -0
- data/lib/mutest/reporter/sequence.rb +24 -0
- data/lib/mutest/repository.rb +80 -0
- data/lib/mutest/require_highjack.rb +24 -0
- data/lib/mutest/result.rb +212 -0
- data/lib/mutest/runner.rb +81 -0
- data/lib/mutest/runner/sink.rb +63 -0
- data/lib/mutest/scope.rb +6 -0
- data/lib/mutest/selector.rb +13 -0
- data/lib/mutest/selector/expression.rb +25 -0
- data/lib/mutest/source_file.rb +47 -0
- data/lib/mutest/subject.rb +94 -0
- data/lib/mutest/subject/method.rb +42 -0
- data/lib/mutest/subject/method/instance.rb +43 -0
- data/lib/mutest/subject/method/singleton.rb +19 -0
- data/lib/mutest/test.rb +14 -0
- data/lib/mutest/util.rb +18 -0
- data/lib/mutest/version.rb +4 -0
- data/lib/mutest/warning_filter.rb +58 -0
- data/lib/mutest/zombifier.rb +119 -0
- data/meta/and.rb +13 -0
- data/meta/and_asgn.rb +12 -0
- data/meta/array.rb +28 -0
- data/meta/begin.rb +19 -0
- data/meta/block.rb +104 -0
- data/meta/block_pass.rb +6 -0
- data/meta/blockarg.rb +8 -0
- data/meta/break.rb +8 -0
- data/meta/case.rb +221 -0
- data/meta/casgn.rb +26 -0
- data/meta/cbase.rb +6 -0
- data/meta/class.rb +10 -0
- data/meta/const.rb +15 -0
- data/meta/csend.rb +8 -0
- data/meta/cvar.rb +5 -0
- data/meta/cvasgn.rb +8 -0
- data/meta/date.rb +57 -0
- data/meta/def.rb +260 -0
- data/meta/defined.rb +7 -0
- data/meta/dstr.rb +11 -0
- data/meta/dsym.rb +12 -0
- data/meta/ensure.rb +7 -0
- data/meta/false.rb +6 -0
- data/meta/float.rb +35 -0
- data/meta/gvar.rb +5 -0
- data/meta/gvasgn.rb +8 -0
- data/meta/hash.rb +22 -0
- data/meta/if.rb +75 -0
- data/meta/int.rb +16 -0
- data/meta/ivar.rb +6 -0
- data/meta/ivasgn.rb +21 -0
- data/meta/kwarg.rb +8 -0
- data/meta/kwbegin.rb +7 -0
- data/meta/kwoptarg.rb +11 -0
- data/meta/kwrestarg.rb +17 -0
- data/meta/lvar.rb +14 -0
- data/meta/lvasgn.rb +8 -0
- data/meta/masgn.rb +5 -0
- data/meta/match_current_line.rb +13 -0
- data/meta/next.rb +9 -0
- data/meta/nil.rb +3 -0
- data/meta/nthref.rb +12 -0
- data/meta/op_assgn.rb +39 -0
- data/meta/or.rb +13 -0
- data/meta/or_asgn.rb +48 -0
- data/meta/range.rb +37 -0
- data/meta/redo.rb +3 -0
- data/meta/regexp.rb +84 -0
- data/meta/regexp/character_types.rb +20 -0
- data/meta/regexp/regexp_alternation_meta.rb +11 -0
- data/meta/regexp/regexp_bol_anchor.rb +8 -0
- data/meta/regexp/regexp_bos_anchor.rb +16 -0
- data/meta/regexp/regexp_capture_group.rb +17 -0
- data/meta/regexp/regexp_eol_anchor.rb +8 -0
- data/meta/regexp/regexp_eos_anchor.rb +6 -0
- data/meta/regexp/regexp_eos_ob_eol_anchor.rb +8 -0
- data/meta/regexp/regexp_one_or_more.rb +32 -0
- data/meta/regexp/regexp_root_expression.rb +8 -0
- data/meta/regexp/regexp_zero_or_more.rb +32 -0
- data/meta/regopt.rb +8 -0
- data/meta/rescue.rb +87 -0
- data/meta/restarg.rb +9 -0
- data/meta/return.rb +14 -0
- data/meta/self.rb +5 -0
- data/meta/send.rb +849 -0
- data/meta/str.rb +5 -0
- data/meta/super.rb +25 -0
- data/meta/sym.rb +6 -0
- data/meta/true.rb +6 -0
- data/meta/until.rb +15 -0
- data/meta/while.rb +24 -0
- data/meta/yield.rb +8 -0
- data/mutest-rspec.gemspec +22 -0
- data/mutest.gemspec +45 -0
- data/spec/integration/mutest/corpus_spec.rb +18 -0
- data/spec/integration/mutest/isolation/fork_spec.rb +8 -0
- data/spec/integration/mutest/null_spec.rb +13 -0
- data/spec/integration/mutest/rspec_spec.rb +11 -0
- data/spec/integration/mutest/test_mutator_handles_types_spec.rb +7 -0
- data/spec/integrations.yml +32 -0
- data/spec/rcov.opts +7 -0
- data/spec/shared/framework_integration_behavior.rb +44 -0
- data/spec/shared/method_matcher_behavior.rb +49 -0
- data/spec/spec_helper.rb +70 -0
- data/spec/support/compress_helper.rb +9 -0
- data/spec/support/corpus.rb +331 -0
- data/spec/support/fake_actor.rb +107 -0
- data/spec/support/file_system.rb +60 -0
- data/spec/support/ice_nine_config.rb +8 -0
- data/spec/support/rb_bug.rb +15 -0
- data/spec/support/ruby_vm.rb +82 -0
- data/spec/support/shared_context.rb +125 -0
- data/spec/support/test_app.rb +5 -0
- data/spec/support/warning.rb +73 -0
- data/spec/support/warnings.yml +5 -0
- data/spec/support/xspec.rb +175 -0
- data/spec/unit/mutest/actor/binding_spec.rb +32 -0
- data/spec/unit/mutest/actor/env_spec.rb +29 -0
- data/spec/unit/mutest/actor/mailbox_spec.rb +25 -0
- data/spec/unit/mutest/actor/message_spec.rb +22 -0
- data/spec/unit/mutest/actor/receiver_spec.rb +56 -0
- data/spec/unit/mutest/actor/sender_spec.rb +22 -0
- data/spec/unit/mutest/ast/meta/optarg_spec.rb +21 -0
- data/spec/unit/mutest/ast/meta/send/proc_predicate_spec.rb +28 -0
- data/spec/unit/mutest/ast/meta/send/receiver_possible_top_level_const_predicate_spec.rb +37 -0
- data/spec/unit/mutest/ast/meta/send_spec.rb +42 -0
- data/spec/unit/mutest/ast/named_children_spec.rb +87 -0
- data/spec/unit/mutest/ast/regexp/parse_spec.rb +5 -0
- data/spec/unit/mutest/ast/regexp/supported_predicate_spec.rb +14 -0
- data/spec/unit/mutest/ast/regexp/transformer/lookup_table/table_spec.rb +19 -0
- data/spec/unit/mutest/ast/regexp/transformer/lookup_table_spec.rb +33 -0
- data/spec/unit/mutest/ast/regexp/transformer_spec.rb +19 -0
- data/spec/unit/mutest/ast/regexp_spec.rb +625 -0
- data/spec/unit/mutest/ast/sexp_spec.rb +36 -0
- data/spec/unit/mutest/ast_spec.rb +55 -0
- data/spec/unit/mutest/cli_spec.rb +247 -0
- data/spec/unit/mutest/context_spec.rb +141 -0
- data/spec/unit/mutest/diff_spec.rb +185 -0
- data/spec/unit/mutest/env/bootstrap_spec.rb +188 -0
- data/spec/unit/mutest/env_spec.rb +100 -0
- data/spec/unit/mutest/expression/method_spec.rb +44 -0
- data/spec/unit/mutest/expression/methods_spec.rb +59 -0
- data/spec/unit/mutest/expression/namespace/exact_spec.rb +26 -0
- data/spec/unit/mutest/expression/namespace/recursive_spec.rb +64 -0
- data/spec/unit/mutest/expression/parser_spec.rb +67 -0
- data/spec/unit/mutest/expression_spec.rb +45 -0
- data/spec/unit/mutest/integration/null_spec.rb +28 -0
- data/spec/unit/mutest/integration/rspec_spec.rb +197 -0
- data/spec/unit/mutest/integration_spec.rb +26 -0
- data/spec/unit/mutest/isolation/fork_spec.rb +155 -0
- data/spec/unit/mutest/isolation/none_spec.rb +16 -0
- data/spec/unit/mutest/loader_spec.rb +42 -0
- data/spec/unit/mutest/matcher/chain_spec.rb +24 -0
- data/spec/unit/mutest/matcher/compiler/subject_prefix_spec.rb +24 -0
- data/spec/unit/mutest/matcher/compiler_spec.rb +76 -0
- data/spec/unit/mutest/matcher/config_spec.rb +45 -0
- data/spec/unit/mutest/matcher/filter_spec.rb +20 -0
- data/spec/unit/mutest/matcher/method/instance_spec.rb +125 -0
- data/spec/unit/mutest/matcher/method/singleton_spec.rb +85 -0
- data/spec/unit/mutest/matcher/methods/instance_spec.rb +58 -0
- data/spec/unit/mutest/matcher/methods/singleton_spec.rb +54 -0
- data/spec/unit/mutest/matcher/namespace_spec.rb +35 -0
- data/spec/unit/mutest/matcher/null_spec.rb +10 -0
- data/spec/unit/mutest/matcher/scope_spec.rb +33 -0
- data/spec/unit/mutest/matcher/static_spec.rb +11 -0
- data/spec/unit/mutest/meta/example/dsl_spec.rb +123 -0
- data/spec/unit/mutest/meta/example/verification_spec.rb +120 -0
- data/spec/unit/mutest/meta/example_spec.rb +32 -0
- data/spec/unit/mutest/mutation_spec.rb +129 -0
- data/spec/unit/mutest/mutator/node_spec.rb +43 -0
- data/spec/unit/mutest/mutator_spec.rb +30 -0
- data/spec/unit/mutest/parallel/driver_spec.rb +26 -0
- data/spec/unit/mutest/parallel/master_spec.rb +335 -0
- data/spec/unit/mutest/parallel/source/array_spec.rb +47 -0
- data/spec/unit/mutest/parallel/worker_spec.rb +65 -0
- data/spec/unit/mutest/parallel_spec.rb +16 -0
- data/spec/unit/mutest/parser_spec.rb +24 -0
- data/spec/unit/mutest/registry_spec.rb +45 -0
- data/spec/unit/mutest/reporter/cli/printer/config_spec.rb +29 -0
- data/spec/unit/mutest/reporter/cli/printer/env_progress_spec.rb +74 -0
- data/spec/unit/mutest/reporter/cli/printer/env_result_spec.rb +35 -0
- data/spec/unit/mutest/reporter/cli/printer/mutation_progress_result_spec.rb +23 -0
- data/spec/unit/mutest/reporter/cli/printer/mutation_result_spec.rb +110 -0
- data/spec/unit/mutest/reporter/cli/printer/status_progressive_spec.rb +43 -0
- data/spec/unit/mutest/reporter/cli/printer/status_spec.rb +119 -0
- data/spec/unit/mutest/reporter/cli/printer/subject_progress_spec.rb +34 -0
- data/spec/unit/mutest/reporter/cli/printer/subject_result_spec.rb +37 -0
- data/spec/unit/mutest/reporter/cli/printer/test_result_spec.rb +14 -0
- data/spec/unit/mutest/reporter/cli/printer_spec.rb +161 -0
- data/spec/unit/mutest/reporter/cli/tput_spec.rb +48 -0
- data/spec/unit/mutest/reporter/cli_spec.rb +212 -0
- data/spec/unit/mutest/reporter/null_spec.rb +12 -0
- data/spec/unit/mutest/reporter/sequence_spec.rb +29 -0
- data/spec/unit/mutest/repository/diff_spec.rb +106 -0
- data/spec/unit/mutest/repository/subject_filter_spec.rb +28 -0
- data/spec/unit/mutest/require_highjack_spec.rb +71 -0
- data/spec/unit/mutest/result/class_methods_spec.rb +49 -0
- data/spec/unit/mutest/result/env_spec.rb +82 -0
- data/spec/unit/mutest/result/mutation_spec.rb +37 -0
- data/spec/unit/mutest/result/subject_spec.rb +109 -0
- data/spec/unit/mutest/result_spec.rb +31 -0
- data/spec/unit/mutest/runner/sink_spec.rb +172 -0
- data/spec/unit/mutest/runner_spec.rb +69 -0
- data/spec/unit/mutest/selector/expression_spec.rb +59 -0
- data/spec/unit/mutest/source_file_spec.rb +42 -0
- data/spec/unit/mutest/subject/method/instance/memoized_spec.rb +78 -0
- data/spec/unit/mutest/subject/method/instance_spec.rb +64 -0
- data/spec/unit/mutest/subject/method/singleton_spec.rb +51 -0
- data/spec/unit/mutest/subject_spec.rb +87 -0
- data/spec/unit/mutest/util/one_spec.rb +20 -0
- data/spec/unit/mutest/warning_filter_spec.rb +99 -0
- data/spec/unit/mutest/zombifier_spec.rb +120 -0
- data/spec/unit/mutest_spec.rb +15 -0
- data/test_app/.rspec +1 -0
- data/test_app/Gemfile.rspec3.4 +7 -0
- data/test_app/Gemfile.rspec3.5 +7 -0
- data/test_app/lib/test_app.rb +109 -0
- data/test_app/lib/test_app/literal.rb +40 -0
- data/test_app/spec/spec_helper.rb +9 -0
- data/test_app/spec/unit/test_app/literal_spec.rb +20 -0
- metadata +784 -9
data/build/Dockerfile
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
FROM alpine:3.4
|
2
|
+
MAINTAINER John Backus <johncbackus@gmail.com>
|
3
|
+
|
4
|
+
VOLUME /app
|
5
|
+
|
6
|
+
# URLs for ruby-install and chruby which help install and manage our ruby matrix
|
7
|
+
ARG RUBY_INSTALL_URL=https://github.com/postmodern/ruby-install/archive/v0.6.0.tar.gz
|
8
|
+
ARG CHRUBY_URL=https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz
|
9
|
+
|
10
|
+
# Directory that the ruby managers will be downloaded to
|
11
|
+
ARG RUBY_MANAGERS_DIR=/tmp/ruby_mangers
|
12
|
+
|
13
|
+
# Compiler environment variables that don't need to carry over to the final image
|
14
|
+
ARG CC=/usr/bin/clang
|
15
|
+
ARG CXX=/usr/bin/clang++
|
16
|
+
|
17
|
+
# Use dkubb's bash strict mode to protect us from bash's many ugliness
|
18
|
+
COPY build/strict-mode.sh /usr/local/sbin/strict-mode.sh
|
19
|
+
|
20
|
+
# Copy over a list of ruby versions to install
|
21
|
+
COPY build/ruby_matrix /tmp
|
22
|
+
|
23
|
+
# Enable strict mode by default
|
24
|
+
ENV BASH_ENV=/usr/local/sbin/strict-mode.sh
|
25
|
+
|
26
|
+
# Write all bundle config to /bundle instead of /app/.bundle
|
27
|
+
ENV BUNDLE_APP_CONFIG /bundle
|
28
|
+
|
29
|
+
RUN apk add --update-cache \
|
30
|
+
bash=4.3.42-r5 \
|
31
|
+
# provides tools like make
|
32
|
+
build-base=0.4-r1 \
|
33
|
+
# install clang to reduce the final binary size for our rubies
|
34
|
+
clang=3.8.0-r0 \
|
35
|
+
# install git so that the bundle can depend on git sources
|
36
|
+
git=2.8.3-r0 \
|
37
|
+
# required for gems that use ffi
|
38
|
+
libffi-dev=3.2.1-r2 \
|
39
|
+
# ruby needs access to things like linux/random.h
|
40
|
+
linux-headers=4.4.6-r1 \
|
41
|
+
# required to compile ruby
|
42
|
+
openssl-dev=1.0.2k-r0 \
|
43
|
+
# required for ruby-versions to download ruby binaries
|
44
|
+
openssl=1.0.2k-r0 \
|
45
|
+
# install ncurses for tput
|
46
|
+
ncurses=6.0-r7 \
|
47
|
+
# install ruby-dev for libruby.so for the FFI bug tests
|
48
|
+
ruby-dev=2.3.1-r0 \
|
49
|
+
# Create ruby managers directory for downloads
|
50
|
+
&& mkdir "$RUBY_MANAGERS_DIR"
|
51
|
+
|
52
|
+
# Download ruby-install
|
53
|
+
ADD $RUBY_INSTALL_URL "$RUBY_MANAGERS_DIR"
|
54
|
+
|
55
|
+
# Download chruby
|
56
|
+
ADD $CHRUBY_URL "$RUBY_MANAGERS_DIR"
|
57
|
+
|
58
|
+
RUN mkdir -p /src/app
|
59
|
+
|
60
|
+
WORKDIR /src/app
|
61
|
+
|
62
|
+
COPY build/docker-exec build/docker-exec
|
63
|
+
|
64
|
+
# Copy the bootstrap script used to setup the final image
|
65
|
+
COPY build/docker-bootstrap.sh /usr/local/sbin
|
66
|
+
|
67
|
+
RUN docker-bootstrap.sh
|
68
|
+
|
69
|
+
USER ci
|
70
|
+
|
71
|
+
ENTRYPOINT ["build/docker-exec"]
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# `make` for ruby-install and chruby don't work within our strict environment
|
4
|
+
# so we have to unset the BASH_ENV variable before executing their setup.
|
5
|
+
# The `make` call creates a new shell so doing `set +o [option]` doesn't impact
|
6
|
+
# the `make install` execution
|
7
|
+
unset_strict(){
|
8
|
+
unset BASH_ENV
|
9
|
+
}
|
10
|
+
|
11
|
+
# Change directories to either chruby's or ruby-install's source directory
|
12
|
+
# and `make install`
|
13
|
+
install_manager(){
|
14
|
+
local manager_dir="$1"
|
15
|
+
|
16
|
+
(
|
17
|
+
unset_strict;
|
18
|
+
cd "$manager_dir" || exit 1;
|
19
|
+
make install
|
20
|
+
)
|
21
|
+
}
|
22
|
+
|
23
|
+
# Install bundler for a given ruby version
|
24
|
+
install_bundler_for_ruby_version(){
|
25
|
+
local ruby_version="$1"
|
26
|
+
|
27
|
+
# chruby unsets variables and uses file globbing
|
28
|
+
# execute in a subshell so that environment changes for chruby don't have
|
29
|
+
# global effect
|
30
|
+
(
|
31
|
+
# Only unset the rules that are required to not break chruby
|
32
|
+
set +o nounset;
|
33
|
+
set +o noglob;
|
34
|
+
source /usr/local/share/chruby/chruby.sh
|
35
|
+
chruby "$ruby_version"
|
36
|
+
gem install bundler
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
40
|
+
# Use ruby-install to install a ruby version
|
41
|
+
install_ruby_version(){
|
42
|
+
local ruby_version="$1"
|
43
|
+
|
44
|
+
# Execute inside of a subshell so that environment changes for ruby-install
|
45
|
+
# don't have a global impact
|
46
|
+
(
|
47
|
+
unset_strict;
|
48
|
+
# Skipping doc installation saves space and time during `docker build`
|
49
|
+
ruby-install --jobs=8 ruby "$ruby_version" -- --disable-install-doc --disable-install-rdoc --disable-install-capi;
|
50
|
+
)
|
51
|
+
|
52
|
+
# Install bundler for the newly installed ruby version
|
53
|
+
install_bundler_for_ruby_version "$ruby_version"
|
54
|
+
}
|
55
|
+
|
56
|
+
# Untar all downloaded ruby managers
|
57
|
+
find "$RUBY_MANAGERS_DIR" -name "*.tar.gz" -exec tar -xzvf {} -C "$RUBY_MANAGERS_DIR" \;
|
58
|
+
|
59
|
+
# Load the ruby manager directories into the array `ruby_managers`
|
60
|
+
mapfile -t ruby_managers < <(find "$RUBY_MANAGERS_DIR" -type d -maxdepth 1 -mindepth 1)
|
61
|
+
|
62
|
+
# Load the ruby versions we want to install into the array `ruby_versions`
|
63
|
+
mapfile -t ruby_versions < /tmp/ruby_matrix
|
64
|
+
|
65
|
+
# Call `make install` for all ruby manager directories downloaded
|
66
|
+
for directory in "${ruby_managers[@]}"; do
|
67
|
+
install_manager "$directory"
|
68
|
+
done
|
69
|
+
|
70
|
+
# Remove ruby manager install files now that we are done with them
|
71
|
+
rm -rf /tmp/ruby_managers
|
72
|
+
|
73
|
+
# Install all ruby versions specified in our ruby matrix file
|
74
|
+
for ruby_version in "${ruby_versions[@]}"; do
|
75
|
+
install_ruby_version "$ruby_version"
|
76
|
+
done
|
77
|
+
|
78
|
+
# Create a new unprivileged user named "ci"
|
79
|
+
adduser -DS -s /bin/bash ci
|
80
|
+
|
81
|
+
# Create our separate bundle config directory which ci is allowed to write to
|
82
|
+
mkdir "$BUNDLE_APP_CONFIG" && chown ci: "$BUNDLE_APP_CONFIG"
|
83
|
+
|
84
|
+
# Create a source directory which files are copied to so writes don't impact the host
|
85
|
+
chown ci: --recursive /src
|
data/build/docker-exec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
if [[ $# -ne 2 ]] ; then
|
4
|
+
echo 'build/docker-exec - run a command on a specified ruby version'
|
5
|
+
echo 'Usage:'
|
6
|
+
echo ' build/docker-exec 2.2.5 rake spec'
|
7
|
+
exit 1
|
8
|
+
fi
|
9
|
+
|
10
|
+
ruby_version="$1"
|
11
|
+
bundled_command="$2"
|
12
|
+
|
13
|
+
cp -r /app ..
|
14
|
+
|
15
|
+
# Disable strict settings that break chruby
|
16
|
+
set +o nounset
|
17
|
+
set +o noglob
|
18
|
+
|
19
|
+
source /usr/local/share/chruby/chruby.sh
|
20
|
+
|
21
|
+
chruby "$ruby_version"
|
22
|
+
|
23
|
+
# Reenable strict settings
|
24
|
+
set -o nounset
|
25
|
+
set -o noglob
|
26
|
+
|
27
|
+
bundle --path /bundle
|
28
|
+
|
29
|
+
bundle exec "$bundled_command"
|
data/build/make-docker
ADDED
data/build/ruby_matrix
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/build/run
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# Taken from dkubb/dockerfiles: https://git.io/viGZZ
|
4
|
+
#
|
5
|
+
# Reference:
|
6
|
+
# http://www.davidpashley.com/articles/writing-robust-shell-scripts/
|
7
|
+
# http://kvz.io/blog/2013/11/21/bash-best-practices/
|
8
|
+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
|
9
|
+
|
10
|
+
set -o errexit # Exit when an expression fails
|
11
|
+
set -o pipefail # Exit when a command in a pipeline fails
|
12
|
+
set -o nounset # Exit when an undefined variable is used
|
13
|
+
set -o noglob # Disable shell globbing
|
14
|
+
set -o noclobber # Disable automatic file overwriting
|
15
|
+
|
16
|
+
IFS=$'\n\t' # Set default field separator to not split on spaces
|
data/circle.yml
ADDED
data/config/devtools.yml
ADDED
data/config/flay.yml
ADDED
data/config/flog.yml
ADDED
data/config/reek.yml
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
---
|
2
|
+
Attribute:
|
3
|
+
enabled: false
|
4
|
+
exclude: []
|
5
|
+
BooleanParameter:
|
6
|
+
enabled: true
|
7
|
+
exclude: []
|
8
|
+
ClassVariable:
|
9
|
+
enabled: true
|
10
|
+
exclude: []
|
11
|
+
ControlParameter:
|
12
|
+
enabled: true
|
13
|
+
exclude:
|
14
|
+
- Mutest::Expression#match_length
|
15
|
+
DataClump:
|
16
|
+
enabled: true
|
17
|
+
exclude: []
|
18
|
+
max_copies: 2
|
19
|
+
min_clump_size: 2
|
20
|
+
DuplicateMethodCall:
|
21
|
+
enabled: false
|
22
|
+
exclude: []
|
23
|
+
max_calls: 1
|
24
|
+
allow_calls: []
|
25
|
+
FeatureEnvy:
|
26
|
+
enabled: false
|
27
|
+
# Buggy smell detector
|
28
|
+
IrresponsibleModule:
|
29
|
+
enabled: false
|
30
|
+
exclude: []
|
31
|
+
LongParameterList:
|
32
|
+
enabled: true
|
33
|
+
exclude:
|
34
|
+
- Mutest::Matcher::Method::Instance#self.build
|
35
|
+
- Mutest::Meta::Example::DSL # 3 vars
|
36
|
+
max_params: 2
|
37
|
+
LongYieldList:
|
38
|
+
enabled: true
|
39
|
+
exclude: []
|
40
|
+
max_params: 2
|
41
|
+
NestedIterators:
|
42
|
+
enabled: true
|
43
|
+
exclude:
|
44
|
+
- Mutest#self.singleton_subclass_instance
|
45
|
+
- Mutest::CLI#parse
|
46
|
+
- Mutest::Mutator::Node::Arguments#emit_argument_mutations
|
47
|
+
- Mutest::Mutator::Node::Resbody#mutate_captures
|
48
|
+
- Mutest::Mutator::Util::Array::Element#dispatch
|
49
|
+
- Mutest::Parallel::Master#run
|
50
|
+
- Mutest::RequireHighjack#self.call
|
51
|
+
- Mutest::Selector::Expression#call
|
52
|
+
- Parser::Lexer#self.new
|
53
|
+
max_allowed_nesting: 1
|
54
|
+
ignore_iterators: []
|
55
|
+
NilCheck:
|
56
|
+
enabled: false
|
57
|
+
RepeatedConditional:
|
58
|
+
enabled: true
|
59
|
+
exclude:
|
60
|
+
- Mutest::Mutator
|
61
|
+
- Mutest::Meta::Example::DSL
|
62
|
+
max_ifs: 1
|
63
|
+
TooManyInstanceVariables:
|
64
|
+
enabled: true
|
65
|
+
exclude:
|
66
|
+
- Mutest::Mutator # 4 vars
|
67
|
+
- Mutest::Parallel::Master # 4 vars
|
68
|
+
- Mutest::Meta::Example::DSL # 4 vars
|
69
|
+
max_instance_variables: 3
|
70
|
+
TooManyMethods:
|
71
|
+
enabled: true
|
72
|
+
exclude:
|
73
|
+
- Mutest::CLI
|
74
|
+
- Mutest::Mutator::Node
|
75
|
+
- Mutest::Parallel::Master
|
76
|
+
max_methods: 10
|
77
|
+
TooManyStatements:
|
78
|
+
enabled: true
|
79
|
+
exclude:
|
80
|
+
- Mutest::CLI#add_debug_options
|
81
|
+
- Mutest::CLI#add_environment_options
|
82
|
+
- Mutest::Reporter::CLI::Printer::Config#run
|
83
|
+
- Mutest::Reporter::CLI::Printer::EnvProgress#run
|
84
|
+
- Mutest::Runner#run_driver
|
85
|
+
- Mutest::Zombifier::File#self.find
|
86
|
+
max_statements: 7
|
87
|
+
UncommunicativeMethodName:
|
88
|
+
enabled: true
|
89
|
+
exclude:
|
90
|
+
- Mutest::AST::Sexp#s
|
91
|
+
- Mutest::Mutation#sha1
|
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
|
+
accept: []
|
112
|
+
UncommunicativeVariableName:
|
113
|
+
enabled: true
|
114
|
+
exclude: []
|
115
|
+
reject:
|
116
|
+
- !ruby/regexp /^.$/
|
117
|
+
- !ruby/regexp /[0-9]$/
|
118
|
+
- !ruby/regexp /[A-Z]/
|
119
|
+
accept: ['force_utf32']
|
120
|
+
UnusedParameters:
|
121
|
+
enabled: true
|
122
|
+
exclude: []
|
123
|
+
UtilityFunction:
|
124
|
+
enabled: true
|
125
|
+
exclude:
|
126
|
+
- Mutest::AST::Sexp#s
|
127
|
+
- Mutest::Actor::Env#new_mailbox
|
128
|
+
- Mutest::CLI#reporter
|
129
|
+
- Mutest::Integration::Null#call
|
130
|
+
- Mutest::Integration::Rspec#parse_example
|
131
|
+
- Mutest::Integration::Rspec#parse_expression # intentional, private
|
132
|
+
- Mutest::Meta::Example::Verification#format_mutations # intentional, private
|
133
|
+
- Mutest::Reporter::CLI::Format::Progressive#new_buffer
|
134
|
+
- Mutest::Reporter::CLI::Printer::StatusProgressive#object # False positive calls super
|
135
|
+
- Mutest::Repository::Diff#tracks? # intentional, private
|
136
|
+
- Mutest::Repository::Diff#within_working_directory? # intentional, private
|
137
|
+
max_helper_calls: 0
|
data/config/rubocop.yml
ADDED
@@ -0,0 +1,395 @@
|
|
1
|
+
---
|
2
|
+
require:
|
3
|
+
- rubocop-rspec
|
4
|
+
- rubocop/devtools
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- 'test_app/**/*'
|
8
|
+
- 'tmp/**/*'
|
9
|
+
- vendor/**/*
|
10
|
+
DisplayCopNames: true
|
11
|
+
TargetRubyVersion: 2.2
|
12
|
+
# This ends up being too spammy
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
Style/ExtraSpacing:
|
16
|
+
AllowForAlignment: true
|
17
|
+
Metrics/LineLength:
|
18
|
+
Max: 100
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Exclude:
|
21
|
+
# Ignore migration DSL
|
22
|
+
- db/migrations/**/*
|
23
|
+
# Ignore RSpec DSL
|
24
|
+
- spec/**/*
|
25
|
+
# Ignore Rake task DSL
|
26
|
+
- Rakefile
|
27
|
+
Style/IfUnlessModifier:
|
28
|
+
MaxLineLength: 100
|
29
|
+
Style/Next:
|
30
|
+
EnforcedStyle: always
|
31
|
+
Style/PercentLiteralDelimiters:
|
32
|
+
PreferredDelimiters:
|
33
|
+
'%i': '[]'
|
34
|
+
'%I': '[]'
|
35
|
+
'%q': '{}'
|
36
|
+
'%Q': '{}'
|
37
|
+
'%r': '{}'
|
38
|
+
'%s': ()
|
39
|
+
'%w': '[]'
|
40
|
+
'%W': '[]'
|
41
|
+
'%x': ()
|
42
|
+
Style/TrivialAccessors:
|
43
|
+
ExactNameMatch: false
|
44
|
+
Style/SymbolArray:
|
45
|
+
Enabled: true
|
46
|
+
Style/BarePercentLiterals:
|
47
|
+
EnforcedStyle: percent_q
|
48
|
+
Style/CollectionMethods:
|
49
|
+
Enabled: true
|
50
|
+
Style/Send:
|
51
|
+
Enabled: true
|
52
|
+
Style/AutoResourceCleanup:
|
53
|
+
Enabled: true
|
54
|
+
Style/FirstArrayElementLineBreak:
|
55
|
+
Enabled: true
|
56
|
+
Style/FirstHashElementLineBreak:
|
57
|
+
Enabled: true
|
58
|
+
Style/FirstMethodArgumentLineBreak:
|
59
|
+
Enabled: true
|
60
|
+
Style/FirstMethodParameterLineBreak:
|
61
|
+
Enabled: true
|
62
|
+
Style/MultilineArrayBraceLayout:
|
63
|
+
Enabled: true
|
64
|
+
Style/MultilineAssignmentLayout:
|
65
|
+
EnforcedStyle: new_line
|
66
|
+
Enabled: true
|
67
|
+
Style/MultilineHashBraceLayout:
|
68
|
+
Enabled: true
|
69
|
+
Style/MultilineMethodCallBraceLayout:
|
70
|
+
Enabled: true
|
71
|
+
Style/MultilineMethodDefinitionBraceLayout:
|
72
|
+
Enabled: true
|
73
|
+
Style/OptionHash:
|
74
|
+
Enabled: true
|
75
|
+
Style/StringMethods:
|
76
|
+
Enabled: true
|
77
|
+
Style/IndentArray:
|
78
|
+
EnforcedStyle: consistent
|
79
|
+
Style/IndentHash:
|
80
|
+
EnforcedStyle: consistent
|
81
|
+
MultilineMethodCallIndentation:
|
82
|
+
EnforcedStyle: indented
|
83
|
+
Style/Alias:
|
84
|
+
EnforcedStyle: prefer_alias_method
|
85
|
+
Style/AlignHash:
|
86
|
+
EnforcedColonStyle: table
|
87
|
+
Style/SignalException:
|
88
|
+
EnforcedStyle: semantic
|
89
|
+
Style/SingleLineBlockParams:
|
90
|
+
Enabled: false
|
91
|
+
# We prefer being able to write
|
92
|
+
#
|
93
|
+
# foo(*%w[bar baz qux norf hello goodbye])
|
94
|
+
#
|
95
|
+
# over
|
96
|
+
#
|
97
|
+
# foo('bar', 'baz', 'qux', 'norf', 'hello', 'goodbye')
|
98
|
+
#
|
99
|
+
# because
|
100
|
+
#
|
101
|
+
# 1. the `%w` signals that all elements are strings without interpolation
|
102
|
+
# 2. the `%w` case is more compact
|
103
|
+
#
|
104
|
+
# The only exception is method invocations with a single argument. These
|
105
|
+
# cases should be `foo('bar')` and never `foo(*%w[bar])`
|
106
|
+
#
|
107
|
+
Lint/UnneededSplatExpansion:
|
108
|
+
Enabled: false
|
109
|
+
# We only use guard clauses when it guards two or more statements:
|
110
|
+
#
|
111
|
+
# # bad
|
112
|
+
# def foo
|
113
|
+
# return if bar
|
114
|
+
#
|
115
|
+
# baz
|
116
|
+
# end
|
117
|
+
#
|
118
|
+
# # good
|
119
|
+
# def foo
|
120
|
+
# baz if bar
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# This includes conditionals with an `else` branch:
|
124
|
+
#
|
125
|
+
# # bad
|
126
|
+
# def foo
|
127
|
+
# return qux if bar
|
128
|
+
#
|
129
|
+
# baz
|
130
|
+
# end
|
131
|
+
#
|
132
|
+
# # good
|
133
|
+
# def foo
|
134
|
+
# if bar
|
135
|
+
# qux
|
136
|
+
# else
|
137
|
+
# baz
|
138
|
+
# end
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
# It is up to the author of the code in question if the condition concerns
|
142
|
+
# exactly two statements
|
143
|
+
#
|
144
|
+
# # ok
|
145
|
+
# def foo
|
146
|
+
# return if bar
|
147
|
+
#
|
148
|
+
# baz
|
149
|
+
# qux
|
150
|
+
# end
|
151
|
+
#
|
152
|
+
# # also ok
|
153
|
+
# def foo
|
154
|
+
# if bar
|
155
|
+
# baz
|
156
|
+
# qux
|
157
|
+
# end
|
158
|
+
# end
|
159
|
+
#
|
160
|
+
# Use a guard clause if more than two statements are being guarded by the conditional
|
161
|
+
#
|
162
|
+
# # bad
|
163
|
+
# def foo
|
164
|
+
# if bar
|
165
|
+
# baz
|
166
|
+
# qux
|
167
|
+
# norf
|
168
|
+
# end
|
169
|
+
# end
|
170
|
+
#
|
171
|
+
# # good
|
172
|
+
# def foo
|
173
|
+
# return if bar
|
174
|
+
#
|
175
|
+
# baz
|
176
|
+
# qux
|
177
|
+
# norf
|
178
|
+
# end
|
179
|
+
Style/GuardClause:
|
180
|
+
Enabled: false
|
181
|
+
# Prefer writing an empty method on two lines
|
182
|
+
#
|
183
|
+
# # good
|
184
|
+
# def foo
|
185
|
+
# end
|
186
|
+
#
|
187
|
+
# # bar
|
188
|
+
# def foo; end
|
189
|
+
#
|
190
|
+
Style/EmptyMethod:
|
191
|
+
EnforcedStyle: expanded
|
192
|
+
# RuboCop disables end alignment by default. Explanation:
|
193
|
+
#
|
194
|
+
# The end alignment cops are in the Lint category because the bad
|
195
|
+
# indentation could be something more serious than just a style issue.
|
196
|
+
# It could be a mistake in which keyword you think you're matching with the end.
|
197
|
+
# (ruby -w warns for these too, by the way.) So for this reason I don't think
|
198
|
+
# we can add auto-correct for these cops.
|
199
|
+
#
|
200
|
+
# From https://github.com/bbatsov/rubocop/pull/1789#issuecomment-92308357
|
201
|
+
#
|
202
|
+
# I think we have more than enough tools that sound the alarms if we have
|
203
|
+
# such an obvious mistake like mismatched tokens.
|
204
|
+
#
|
205
|
+
# - Our specs are likely to fail
|
206
|
+
# - RuboCop will flag it regardless, it just doesn't autocorrect it by default
|
207
|
+
# - Ruby will emit a warning which we configure to fail our specs
|
208
|
+
#
|
209
|
+
# So I think it is safe to enable autocorrect for end alignment cops because it
|
210
|
+
# does not seem unsafe and it improves workflow to be able to autocorrect alignment
|
211
|
+
Lint/DefEndAlignment:
|
212
|
+
AutoCorrect: true
|
213
|
+
# See explanation for `Lint/DefEndAlignment`
|
214
|
+
Lint/EndAlignment:
|
215
|
+
AutoCorrect: true
|
216
|
+
|
217
|
+
# TODO is inlined so that it takes precedence.
|
218
|
+
|
219
|
+
# This configuration was generated by
|
220
|
+
# `rubocop --auto-gen-config --exclude-limit 0`
|
221
|
+
# on 2017-01-27 00:08:49 -0800 using RuboCop version 0.47.1.
|
222
|
+
# The point is for the user to remove these configuration records
|
223
|
+
# one by one as the offenses are removed from the code base.
|
224
|
+
# Note that changes in the inspected code, or installation of new
|
225
|
+
# versions of RuboCop, may require this file to be generated again.
|
226
|
+
|
227
|
+
# Offense count: 1
|
228
|
+
# Cop supports --auto-correct.
|
229
|
+
# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
|
230
|
+
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
231
|
+
|
232
|
+
# Offense count: 4
|
233
|
+
# Cop supports --auto-correct.
|
234
|
+
Lint/UnifiedInteger:
|
235
|
+
Enabled: false
|
236
|
+
|
237
|
+
# Offense count: 10
|
238
|
+
Metrics/AbcSize:
|
239
|
+
Max: 20
|
240
|
+
|
241
|
+
# Offense count: 84
|
242
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
243
|
+
# URISchemes: http, https
|
244
|
+
Metrics/LineLength:
|
245
|
+
Max: 120
|
246
|
+
|
247
|
+
# Offense count: 7
|
248
|
+
# Cop supports --auto-correct.
|
249
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
250
|
+
# SupportedStyles: always, conditionals
|
251
|
+
Style/AndOr:
|
252
|
+
Enabled: false
|
253
|
+
|
254
|
+
# Offense count: 150
|
255
|
+
# Cop supports --auto-correct.
|
256
|
+
Style/FirstMethodArgumentLineBreak:
|
257
|
+
Enabled: false
|
258
|
+
|
259
|
+
# Offense count: 2
|
260
|
+
# Cop supports --auto-correct.
|
261
|
+
# Configuration parameters: SupportedStyles, IndentationWidth.
|
262
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_braces
|
263
|
+
Style/IndentHash:
|
264
|
+
EnforcedStyle: special_inside_parentheses
|
265
|
+
|
266
|
+
# Offense count: 21
|
267
|
+
# Cop supports --auto-correct.
|
268
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
269
|
+
# SupportedStyles: call, braces
|
270
|
+
Style/LambdaCall:
|
271
|
+
Enabled: false
|
272
|
+
|
273
|
+
# Offense count: 12
|
274
|
+
# Cop supports --auto-correct.
|
275
|
+
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
|
276
|
+
# SupportedStyles: skip_modifier_ifs, always
|
277
|
+
Style/Next:
|
278
|
+
Enabled: false
|
279
|
+
|
280
|
+
# Devtools Cops
|
281
|
+
Devtools/GroupSingleLineLet:
|
282
|
+
Enabled: false
|
283
|
+
|
284
|
+
# RSpec Cops
|
285
|
+
RSpec/MessageExpectation:
|
286
|
+
Enabled: true
|
287
|
+
RSpec/ExampleLength:
|
288
|
+
Enabled: false
|
289
|
+
RSpec/VerifiedDoubles:
|
290
|
+
IgnoreSymbolicNames: true
|
291
|
+
RSpec/DescribeClass:
|
292
|
+
Exclude:
|
293
|
+
- 'spec/integration/mutest/**/*'
|
294
|
+
|
295
|
+
|
296
|
+
# Inlining RSpec todos for the same reason as the RSpec ones
|
297
|
+
|
298
|
+
# This configuration was generated by
|
299
|
+
# `rubocop --auto-gen-config`
|
300
|
+
# on 2017-01-27 19:41:43 -0800 using RuboCop version 0.47.1.
|
301
|
+
# The point is for the user to remove these configuration records
|
302
|
+
# one by one as the offenses are removed from the code base.
|
303
|
+
# Note that changes in the inspected code, or installation of new
|
304
|
+
# versions of RuboCop, may require this file to be generated again.
|
305
|
+
|
306
|
+
# Offense count: 89
|
307
|
+
# Configuration parameters: CustomIncludeMethods.
|
308
|
+
RSpec/EmptyExampleGroup:
|
309
|
+
Exclude:
|
310
|
+
- 'spec/unit/mutest/meta/example/dsl_spec.rb'
|
311
|
+
- 'spec/unit/mutest/reporter/cli/printer/config_spec.rb'
|
312
|
+
- 'spec/unit/mutest/reporter/cli/printer/env_progress_spec.rb'
|
313
|
+
- 'spec/unit/mutest/reporter/cli/printer/env_result_spec.rb'
|
314
|
+
- 'spec/unit/mutest/reporter/cli/printer/mutation_progress_result_spec.rb'
|
315
|
+
- 'spec/unit/mutest/reporter/cli/printer/mutation_result_spec.rb'
|
316
|
+
- 'spec/unit/mutest/reporter/cli/printer/status_progressive_spec.rb'
|
317
|
+
- 'spec/unit/mutest/reporter/cli/printer/status_spec.rb'
|
318
|
+
- 'spec/unit/mutest/reporter/cli/printer/subject_progress_spec.rb'
|
319
|
+
- 'spec/unit/mutest/reporter/cli/printer/subject_result_spec.rb'
|
320
|
+
- 'spec/unit/mutest/reporter/cli/printer/test_result_spec.rb'
|
321
|
+
- 'spec/unit/mutest/reporter/cli/printer_spec.rb'
|
322
|
+
- 'spec/unit/mutest/reporter/cli_spec.rb'
|
323
|
+
|
324
|
+
# Offense count: 13
|
325
|
+
# Configuration parameters: CustomTransform, IgnoreMethods.
|
326
|
+
RSpec/FilePath:
|
327
|
+
Exclude:
|
328
|
+
- 'spec/unit/mutest/loader_spec.rb'
|
329
|
+
- 'spec/unit/mutest/matcher/chain_spec.rb'
|
330
|
+
- 'spec/unit/mutest/matcher/compiler/subject_prefix_spec.rb'
|
331
|
+
- 'spec/unit/mutest/matcher/compiler_spec.rb'
|
332
|
+
- 'spec/unit/mutest/matcher/filter_spec.rb'
|
333
|
+
- 'spec/unit/mutest/matcher/method/instance_spec.rb'
|
334
|
+
- 'spec/unit/mutest/matcher/method/singleton_spec.rb'
|
335
|
+
- 'spec/unit/mutest/matcher/methods/instance_spec.rb'
|
336
|
+
- 'spec/unit/mutest/matcher/methods/singleton_spec.rb'
|
337
|
+
- 'spec/unit/mutest/matcher/namespace_spec.rb'
|
338
|
+
- 'spec/unit/mutest/matcher/null_spec.rb'
|
339
|
+
- 'spec/unit/mutest/matcher/scope_spec.rb'
|
340
|
+
- 'spec/unit/mutest/matcher/static_spec.rb'
|
341
|
+
|
342
|
+
# Offense count: 5
|
343
|
+
# Configuration parameters: AssignmentOnly.
|
344
|
+
RSpec/InstanceVariable:
|
345
|
+
Exclude:
|
346
|
+
- 'spec/unit/mutest/parallel/master_spec.rb'
|
347
|
+
|
348
|
+
# Offense count: 93
|
349
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
350
|
+
# SupportedStyles: allow, expect
|
351
|
+
RSpec/MessageExpectation:
|
352
|
+
Enabled: false
|
353
|
+
|
354
|
+
# Offense count: 94
|
355
|
+
# Configuration parameters: SupportedStyles.
|
356
|
+
# SupportedStyles: have_received, receive
|
357
|
+
RSpec/MessageSpies:
|
358
|
+
EnforcedStyle: receive
|
359
|
+
|
360
|
+
# Offense count: 5
|
361
|
+
RSpec/MultipleExpectations:
|
362
|
+
Max: 3
|
363
|
+
|
364
|
+
# Offense count: 57
|
365
|
+
RSpec/NamedSubject:
|
366
|
+
Enabled: false
|
367
|
+
|
368
|
+
# Offense count: 70
|
369
|
+
# Configuration parameters: Max.
|
370
|
+
RSpec/NestedGroups:
|
371
|
+
Exclude:
|
372
|
+
- 'spec/unit/mutest/ast/named_children_spec.rb'
|
373
|
+
- 'spec/unit/mutest/cli_spec.rb'
|
374
|
+
- 'spec/unit/mutest/expression/namespace/recursive_spec.rb'
|
375
|
+
- 'spec/unit/mutest/mutation_spec.rb'
|
376
|
+
- 'spec/unit/mutest/parallel/master_spec.rb'
|
377
|
+
- 'spec/unit/mutest/reporter/cli/printer/mutation_result_spec.rb'
|
378
|
+
- 'spec/unit/mutest/reporter/cli/printer/status_progressive_spec.rb'
|
379
|
+
- 'spec/unit/mutest/reporter/cli/printer/status_spec.rb'
|
380
|
+
- 'spec/unit/mutest/reporter/cli/printer_spec.rb'
|
381
|
+
- 'spec/unit/mutest/reporter/cli_spec.rb'
|
382
|
+
- 'spec/unit/mutest/repository/diff_spec.rb'
|
383
|
+
- 'spec/unit/mutest/runner/sink_spec.rb'
|
384
|
+
|
385
|
+
# Offense count: 18
|
386
|
+
# Configuration parameters: IgnoreSymbolicNames.
|
387
|
+
RSpec/VerifiedDoubles:
|
388
|
+
Exclude:
|
389
|
+
- 'spec/unit/mutest/actor/binding_spec.rb'
|
390
|
+
- 'spec/unit/mutest/integration/rspec_spec.rb'
|
391
|
+
- 'spec/unit/mutest/reporter/cli/printer_spec.rb'
|
392
|
+
- 'spec/unit/mutest/repository/subject_filter_spec.rb'
|
393
|
+
- 'spec/unit/mutest/result/mutation_spec.rb'
|
394
|
+
- 'spec/unit/mutest/subject/method/instance/memoized_spec.rb'
|
395
|
+
- 'spec/unit/mutest/subject_spec.rb'
|