diff --git a/lib/laser.rb b/lib/laser.rb index 00e87d0..b1e0877 100644 --- a/lib/laser.rb +++ b/lib/laser.rb @@ -94,7 +94,7 @@ def self.debug? require 'laser/analysis/visitor' require 'laser/analysis/annotations' -require 'laser/analysis/unused_methods' +require 'laser/analysis/method_analysis/method_analysis' # Runners require 'laser/runner' require 'laser/rake/task' @@ -105,4 +105,4 @@ def self.debug? require 'laser/version' # All methods created from the stdlib should never be marked as unused. Laser::Analysis::Bootstrap.load_standard_library -# override info needs stdlib methods to be instantiated \ No newline at end of file +# override info needs stdlib methods to be instantiated diff --git a/lib/laser/analysis/annotations.rb b/lib/laser/analysis/annotations.rb index 91f5947..b5587c5 100644 --- a/lib/laser/analysis/annotations.rb +++ b/lib/laser/analysis/annotations.rb @@ -92,4 +92,4 @@ def self.add_computed_property(name, &blk) Dir[File.expand_path(File.join(File.dirname(__FILE__), 'annotations', '**', '*.rb'))].each do |file| load file -end \ No newline at end of file +end diff --git a/lib/laser/analysis/annotations/comment_attachment_annotation.rb b/lib/laser/analysis/annotations/comment_attachment_annotation.rb index 71e2376..e4380f7 100644 --- a/lib/laser/analysis/annotations/comment_attachment_annotation.rb +++ b/lib/laser/analysis/annotations/comment_attachment_annotation.rb @@ -63,4 +63,4 @@ def extract_comments(text) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/annotations/node_pointers_annotation.rb b/lib/laser/analysis/annotations/node_pointers_annotation.rb index f54208a..a492acd 100644 --- a/lib/laser/analysis/annotations/node_pointers_annotation.rb +++ b/lib/laser/analysis/annotations/node_pointers_annotation.rb @@ -33,4 +33,4 @@ def default_visit(node) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/annotations/runtime_annotation.rb b/lib/laser/analysis/annotations/runtime_annotation.rb index 54cd32e..84a7707 100644 --- a/lib/laser/analysis/annotations/runtime_annotation.rb +++ b/lib/laser/analysis/annotations/runtime_annotation.rb @@ -52,4 +52,4 @@ def visit_with_runtime(*nodes, new_runtime) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/argument_expansion.rb b/lib/laser/analysis/argument_expansion.rb index 222e67d..4e51af5 100644 --- a/lib/laser/analysis/argument_expansion.rb +++ b/lib/laser/analysis/argument_expansion.rb @@ -129,4 +129,4 @@ def node_constant_values(node) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/arity.rb b/lib/laser/analysis/arity.rb index 60c2737..168202e 100644 --- a/lib/laser/analysis/arity.rb +++ b/lib/laser/analysis/arity.rb @@ -31,4 +31,4 @@ def compatible?(other) ANY = Arity.new(0..Float::INFINITY) end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bindings.rb b/lib/laser/analysis/bindings.rb index 43ba172..aacea60 100644 --- a/lib/laser/analysis/bindings.rb +++ b/lib/laser/analysis/bindings.rb @@ -141,4 +141,4 @@ def is_block? end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/bootstrap.rb b/lib/laser/analysis/bootstrap/bootstrap.rb index ca3e7b2..972a3af 100644 --- a/lib/laser/analysis/bootstrap/bootstrap.rb +++ b/lib/laser/analysis/bootstrap/bootstrap.rb @@ -307,4 +307,4 @@ def self.stub_global_type(name, type) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/dispatch_results.rb b/lib/laser/analysis/bootstrap/dispatch_results.rb index 41f9525..8f4f641 100644 --- a/lib/laser/analysis/bootstrap/dispatch_results.rb +++ b/lib/laser/analysis/bootstrap/dispatch_results.rb @@ -189,4 +189,4 @@ def fails_dispatch(raise_type) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_class.rb b/lib/laser/analysis/bootstrap/laser_class.rb index 0760cc9..ebb514b 100644 --- a/lib/laser/analysis/bootstrap/laser_class.rb +++ b/lib/laser/analysis/bootstrap/laser_class.rb @@ -99,4 +99,4 @@ def inspect end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_method.rb b/lib/laser/analysis/bootstrap/laser_method.rb index e49165c..3bd48fa 100644 --- a/lib/laser/analysis/bootstrap/laser_method.rb +++ b/lib/laser/analysis/bootstrap/laser_method.rb @@ -67,6 +67,13 @@ def argument_annotations end end + # Combines all known return types for this method into one union type. + def combined_return_type + Types::UnionType.new(@type_instantiations.keys.map do |argtypes| + return_type_for_types(*argtypes) + end) + end + def yield_type return annotated_yield_usage if annotated_yield_usage return @yield_type if @yield_type @@ -173,12 +180,6 @@ def check_return_type_against_expectations(return_type) @proc.ast_node.add_error(ImproperOverrideTypeError.new( "All methods named #{self.name} should return a subtype of #{expectation.inspect}", @proc.ast_node)) - elsif self.name.end_with?('?') - if !Types.subtype?(return_type, Types::BOOL_OR_NIL) - @proc.ast_node.add_error(ImproperOverrideTypeError.new( - "All methods whose name ends in ? should return a subtype of TrueClass | FalseClass | NilClass", - @proc.ast_node)) - end end end @@ -284,4 +285,4 @@ def refine_arity(new_arity) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_module.rb b/lib/laser/analysis/bootstrap/laser_module.rb index 5b73a27..fd8d61f 100644 --- a/lib/laser/analysis/bootstrap/laser_module.rb +++ b/lib/laser/analysis/bootstrap/laser_module.rb @@ -404,4 +404,4 @@ def module_function(*args) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_module_copy.rb b/lib/laser/analysis/bootstrap/laser_module_copy.rb index 719cbaf..30dd274 100644 --- a/lib/laser/analysis/bootstrap/laser_module_copy.rb +++ b/lib/laser/analysis/bootstrap/laser_module_copy.rb @@ -71,4 +71,4 @@ def instance_methods(include_superclass = true) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_object.rb b/lib/laser/analysis/bootstrap/laser_object.rb index fda07cf..f0f7ade 100644 --- a/lib/laser/analysis/bootstrap/laser_object.rb +++ b/lib/laser/analysis/bootstrap/laser_object.rb @@ -66,4 +66,4 @@ def instance_variable_set(var, value) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_proc.rb b/lib/laser/analysis/bootstrap/laser_proc.rb index 32fe31b..46e9738 100644 --- a/lib/laser/analysis/bootstrap/laser_proc.rb +++ b/lib/laser/analysis/bootstrap/laser_proc.rb @@ -152,4 +152,4 @@ def raises end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/bootstrap/laser_singleton_class.rb b/lib/laser/analysis/bootstrap/laser_singleton_class.rb index 805c33b..f764e03 100644 --- a/lib/laser/analysis/bootstrap/laser_singleton_class.rb +++ b/lib/laser/analysis/bootstrap/laser_singleton_class.rb @@ -41,4 +41,4 @@ def get_instance(scope=nil) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/comments.rb b/lib/laser/analysis/comments.rb index 449edd7..6018d2d 100644 --- a/lib/laser/analysis/comments.rb +++ b/lib/laser/analysis/comments.rb @@ -32,4 +32,4 @@ def annotation_map @map = annotations.inject(initial) { |acc, note| acc[note.name] << note; acc } end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow.rb b/lib/laser/analysis/control_flow.rb index 0a4a568..50878c0 100644 --- a/lib/laser/analysis/control_flow.rb +++ b/lib/laser/analysis/control_flow.rb @@ -26,4 +26,4 @@ def self.perform_cfg_analysis(tree, text, opts={}) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/alias_analysis.rb b/lib/laser/analysis/control_flow/alias_analysis.rb index 0554e98..a40a305 100644 --- a/lib/laser/analysis/control_flow/alias_analysis.rb +++ b/lib/laser/analysis/control_flow/alias_analysis.rb @@ -28,4 +28,4 @@ def value_aliases(value_to_match) end end # ControlFlow end # Analysis -end # \ No newline at end of file +end # diff --git a/lib/laser/analysis/control_flow/basic_block.rb b/lib/laser/analysis/control_flow/basic_block.rb index f48d3ae..bf9ee20 100644 --- a/lib/laser/analysis/control_flow/basic_block.rb +++ b/lib/laser/analysis/control_flow/basic_block.rb @@ -102,4 +102,4 @@ def instructions end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/cfg_builder.rb b/lib/laser/analysis/control_flow/cfg_builder.rb index d04e83a..018d855 100644 --- a/lib/laser/analysis/control_flow/cfg_builder.rb +++ b/lib/laser/analysis/control_flow/cfg_builder.rb @@ -2503,4 +2503,4 @@ def start_block(block) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/cfg_instruction.rb b/lib/laser/analysis/control_flow/cfg_instruction.rb index a69cd1d..2fee291 100644 --- a/lib/laser/analysis/control_flow/cfg_instruction.rb +++ b/lib/laser/analysis/control_flow/cfg_instruction.rb @@ -187,4 +187,4 @@ def operand_range end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/constant_propagation.rb b/lib/laser/analysis/control_flow/constant_propagation.rb index f7c5820..7a9eab9 100644 --- a/lib/laser/analysis/control_flow/constant_propagation.rb +++ b/lib/laser/analysis/control_flow/constant_propagation.rb @@ -654,4 +654,4 @@ def validate_tuple_expectation(instruction) end # ConstantPropagation end # ControlFlow end # Analysis -end # \ No newline at end of file +end # diff --git a/lib/laser/analysis/control_flow/control_flow_graph.rb b/lib/laser/analysis/control_flow/control_flow_graph.rb index 5672b85..93e9e6e 100644 --- a/lib/laser/analysis/control_flow/control_flow_graph.rb +++ b/lib/laser/analysis/control_flow/control_flow_graph.rb @@ -372,4 +372,4 @@ def kill_unexecuted_edges(remove=false) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/guaranteed_super_detection.rb b/lib/laser/analysis/control_flow/guaranteed_super_detection.rb index 8af1e4a..9135c3c 100644 --- a/lib/laser/analysis/control_flow/guaranteed_super_detection.rb +++ b/lib/laser/analysis/control_flow/guaranteed_super_detection.rb @@ -18,4 +18,4 @@ def guaranteed_super_on_success? end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/lifetime_analysis.rb b/lib/laser/analysis/control_flow/lifetime_analysis.rb index 94a1bc1..b2f4b74 100644 --- a/lib/laser/analysis/control_flow/lifetime_analysis.rb +++ b/lib/laser/analysis/control_flow/lifetime_analysis.rb @@ -88,4 +88,4 @@ def find_live_visited(current, visit, live) end # module LifetimeAnalysis end # module ControlFlow end # module Analysis -end # module Laser \ No newline at end of file +end # module Laser diff --git a/lib/laser/analysis/control_flow/method_call_search.rb b/lib/laser/analysis/control_flow/method_call_search.rb index c709b29..b04fe80 100644 --- a/lib/laser/analysis/control_flow/method_call_search.rb +++ b/lib/laser/analysis/control_flow/method_call_search.rb @@ -22,4 +22,4 @@ def find_method_calls(method_to_find, opts) end end # ControlFlow end # Analysis -end # \ No newline at end of file +end # diff --git a/lib/laser/analysis/control_flow/raise_properties.rb b/lib/laser/analysis/control_flow/raise_properties.rb index 225887c..444adf2 100644 --- a/lib/laser/analysis/control_flow/raise_properties.rb +++ b/lib/laser/analysis/control_flow/raise_properties.rb @@ -22,4 +22,4 @@ def find_raise_frequency end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/simulation.rb b/lib/laser/analysis/control_flow/simulation.rb index 35c6cac..8e73d04 100644 --- a/lib/laser/analysis/control_flow/simulation.rb +++ b/lib/laser/analysis/control_flow/simulation.rb @@ -387,4 +387,4 @@ def simulate_module_eval(receiver, args, block) end # Simulation end # ControlFlow end # Analysis -end # Laser \ No newline at end of file +end # Laser diff --git a/lib/laser/analysis/control_flow/static_single_assignment.rb b/lib/laser/analysis/control_flow/static_single_assignment.rb index 1022693..77d4960 100644 --- a/lib/laser/analysis/control_flow/static_single_assignment.rb +++ b/lib/laser/analysis/control_flow/static_single_assignment.rb @@ -182,4 +182,4 @@ def new_ssa_name(temp) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/unreachability_analysis.rb b/lib/laser/analysis/control_flow/unreachability_analysis.rb index 2c0d6ba..f693b5b 100644 --- a/lib/laser/analysis/control_flow/unreachability_analysis.rb +++ b/lib/laser/analysis/control_flow/unreachability_analysis.rb @@ -54,4 +54,4 @@ def dfs_for_dead_code(node) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/control_flow/unused_variables.rb b/lib/laser/analysis/control_flow/unused_variables.rb index 61ef718..e97417c 100644 --- a/lib/laser/analysis/control_flow/unused_variables.rb +++ b/lib/laser/analysis/control_flow/unused_variables.rb @@ -88,4 +88,4 @@ def killable_with_unused_target?(insn) end end # ControlFlow end # Analysis -end # \ No newline at end of file +end # diff --git a/lib/laser/analysis/control_flow/yield_properties.rb b/lib/laser/analysis/control_flow/yield_properties.rb index ded0fa5..1bbfb08 100644 --- a/lib/laser/analysis/control_flow/yield_properties.rb +++ b/lib/laser/analysis/control_flow/yield_properties.rb @@ -100,4 +100,4 @@ def potential_block_calls(block_value = nil, opts) end end # ControlFlow end # Analysis -end # \ No newline at end of file +end # diff --git a/lib/laser/analysis/errors.rb b/lib/laser/analysis/errors.rb index 0a7d97c..c5c8874 100644 --- a/lib/laser/analysis/errors.rb +++ b/lib/laser/analysis/errors.rb @@ -136,4 +136,4 @@ class DiscardedRHSError < Laser::Error class UnassignedLHSError < Laser::Error severity SIMPLE_ERROR end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/laser_utils.rb b/lib/laser/analysis/laser_utils.rb index 5ef869a..b852f36 100644 --- a/lib/laser/analysis/laser_utils.rb +++ b/lib/laser/analysis/laser_utils.rb @@ -15,4 +15,4 @@ def normal_class_for(arg) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/lexical_analysis.rb b/lib/laser/analysis/lexical_analysis.rb index c94ed9b..07be14a 100644 --- a/lib/laser/analysis/lexical_analysis.rb +++ b/lib/laser/analysis/lexical_analysis.rb @@ -169,4 +169,4 @@ def _split_body_with_raw_token(body, token) return body[0,max], body[max..-1] end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/method_analysis/method_analysis.rb b/lib/laser/analysis/method_analysis/method_analysis.rb new file mode 100644 index 0000000..db1c6de --- /dev/null +++ b/lib/laser/analysis/method_analysis/method_analysis.rb @@ -0,0 +1,26 @@ +require_relative 'unused_methods' +module Laser + module Analysis + # General-purpose method analysis functions. + module MethodAnalysis + extend UnusedMethodDetection + def self.each_user_method + return enum_for(__method__) unless block_given? + classes = Set[] + Analysis::ProtocolRegistry.class_protocols.each do |key, klass| + if should_analyze?(klass) && !classes.include?(klass) + classes << klass + klass.__all_instance_methods(false).each do |name| + yield klass.instance_method(name) + end + end + end + end + + def self.should_analyze?(klass) + !(Analysis::LaserSingletonClass === klass) || + klass < ClassRegistry['Module'] + end + end + end +end diff --git a/lib/laser/analysis/method_analysis/unused_methods.rb b/lib/laser/analysis/method_analysis/unused_methods.rb new file mode 100644 index 0000000..aba28ce --- /dev/null +++ b/lib/laser/analysis/method_analysis/unused_methods.rb @@ -0,0 +1,11 @@ +module Laser + module Analysis + module UnusedMethodDetection + def unused_methods + each_user_method.reject do |method| + method.dispatched? || method.builtin || method.special + end + end + end + end +end diff --git a/lib/laser/analysis/method_call.rb b/lib/laser/analysis/method_call.rb index 06e2818..76b564a 100644 --- a/lib/laser/analysis/method_call.rb +++ b/lib/laser/analysis/method_call.rb @@ -65,4 +65,4 @@ def arg_node end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/override_safety_info.rb b/lib/laser/analysis/override_safety_info.rb index 9b4c46e..e41c46b 100644 --- a/lib/laser/analysis/override_safety_info.rb +++ b/lib/laser/analysis/override_safety_info.rb @@ -76,4 +76,4 @@ class << self end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/protocol_registry.rb b/lib/laser/analysis/protocol_registry.rb index e72ccc0..bbdebd6 100644 --- a/lib/laser/analysis/protocol_registry.rb +++ b/lib/laser/analysis/protocol_registry.rb @@ -27,4 +27,4 @@ def self.[](class_name) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/scope.rb b/lib/laser/analysis/scope.rb index e5c51b0..ea463a9 100644 --- a/lib/laser/analysis/scope.rb +++ b/lib/laser/analysis/scope.rb @@ -115,4 +115,4 @@ def lookup_local(str) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/sexp.rb b/lib/laser/analysis/sexp.rb index 72002ba..5b5155d 100644 --- a/lib/laser/analysis/sexp.rb +++ b/lib/laser/analysis/sexp.rb @@ -156,4 +156,4 @@ def method_call end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/sexp_analysis.rb b/lib/laser/analysis/sexp_analysis.rb index e8a9f54..30cfba8 100644 --- a/lib/laser/analysis/sexp_analysis.rb +++ b/lib/laser/analysis/sexp_analysis.rb @@ -37,4 +37,4 @@ def find_sexps(type, tree = self.parse(self.body)) result end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/sexp_extensions/constant_extraction.rb b/lib/laser/analysis/sexp_extensions/constant_extraction.rb index 8cf20a8..ded9249 100644 --- a/lib/laser/analysis/sexp_extensions/constant_extraction.rb +++ b/lib/laser/analysis/sexp_extensions/constant_extraction.rb @@ -112,4 +112,4 @@ def constant_value end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/sexp_extensions/source_location.rb b/lib/laser/analysis/sexp_extensions/source_location.rb index 151eb99..65740e1 100644 --- a/lib/laser/analysis/sexp_extensions/source_location.rb +++ b/lib/laser/analysis/sexp_extensions/source_location.rb @@ -161,4 +161,4 @@ def text_at(location, offset, length) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/sexp_extensions/type_inference.rb b/lib/laser/analysis/sexp_extensions/type_inference.rb index 976d493..b879f91 100644 --- a/lib/laser/analysis/sexp_extensions/type_inference.rb +++ b/lib/laser/analysis/sexp_extensions/type_inference.rb @@ -44,4 +44,4 @@ def expr_type end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/signature.rb b/lib/laser/analysis/signature.rb index 1b44409..fa6462d 100644 --- a/lib/laser/analysis/signature.rb +++ b/lib/laser/analysis/signature.rb @@ -73,4 +73,4 @@ module Signature extend ArgumentListHandling end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/special_methods/send.rb b/lib/laser/analysis/special_methods/send.rb index 54b02aa..2c88f85 100644 --- a/lib/laser/analysis/special_methods/send.rb +++ b/lib/laser/analysis/special_methods/send.rb @@ -76,4 +76,4 @@ def raise_frequency_for_types(self_type, arg_types, block_type) end end end -end \ No newline at end of file +end diff --git a/lib/laser/analysis/unused_methods.rb b/lib/laser/analysis/unused_methods.rb deleted file mode 100644 index d635ec4..0000000 --- a/lib/laser/analysis/unused_methods.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Laser - module Analysis - module UnusedMethodDetection - def self.unused_methods - methods = [] - classes = Set[] - Analysis::ProtocolRegistry.class_protocols.each do |key, klass| - next if Analysis::LaserSingletonClass === klass || classes.include?(klass) - klass.__all_instance_methods(false).each do |name| - method = klass.instance_method(name) - unless method.dispatched? || method.builtin || method.special - methods << method - end - end - classes << klass - end - methods - end - end - end -end \ No newline at end of file diff --git a/lib/laser/analysis/visitor.rb b/lib/laser/analysis/visitor.rb index dce8f71..7fc5b55 100644 --- a/lib/laser/analysis/visitor.rb +++ b/lib/laser/analysis/visitor.rb @@ -138,4 +138,4 @@ def lines end end -end \ No newline at end of file +end diff --git a/lib/laser/annotation_parser/annotations_parser.rb b/lib/laser/annotation_parser/annotations_parser.rb index d5ff1a8..35503c8 100644 --- a/lib/laser/annotation_parser/annotations_parser.rb +++ b/lib/laser/annotation_parser/annotations_parser.rb @@ -745,4 +745,4 @@ class AnnotationParser < Treetop::Runtime::CompiledParser end end -end \ No newline at end of file +end diff --git a/lib/laser/annotation_parser/class_annotations_parser.rb b/lib/laser/annotation_parser/class_annotations_parser.rb index cdd9ed3..85a6855 100644 --- a/lib/laser/annotation_parser/class_annotations_parser.rb +++ b/lib/laser/annotation_parser/class_annotations_parser.rb @@ -651,4 +651,4 @@ class ClassParser < Treetop::Runtime::CompiledParser end end -end \ No newline at end of file +end diff --git a/lib/laser/annotation_parser/overload_parser.rb b/lib/laser/annotation_parser/overload_parser.rb index 56ccfc7..cdec2e0 100644 --- a/lib/laser/annotation_parser/overload_parser.rb +++ b/lib/laser/annotation_parser/overload_parser.rb @@ -163,4 +163,4 @@ class OverloadParser < Treetop::Runtime::CompiledParser end end -end \ No newline at end of file +end diff --git a/lib/laser/annotation_parser/parsers.rb b/lib/laser/annotation_parser/parsers.rb index 464c567..00c3066 100644 --- a/lib/laser/annotation_parser/parsers.rb +++ b/lib/laser/annotation_parser/parsers.rb @@ -3,4 +3,4 @@ require_relative 'class_annotations_parser' require_relative 'structural_parser' require_relative 'overload_parser' -require_relative 'annotations_parser' \ No newline at end of file +require_relative 'annotations_parser' diff --git a/lib/laser/annotation_parser/structural_parser.rb b/lib/laser/annotation_parser/structural_parser.rb index 951f723..4d005d7 100644 --- a/lib/laser/annotation_parser/structural_parser.rb +++ b/lib/laser/annotation_parser/structural_parser.rb @@ -403,4 +403,4 @@ class StructuralParser < Treetop::Runtime::CompiledParser end end -end \ No newline at end of file +end diff --git a/lib/laser/annotation_parser/useful_parsers_parser.rb b/lib/laser/annotation_parser/useful_parsers_parser.rb index f32696d..2e967de 100644 --- a/lib/laser/annotation_parser/useful_parsers_parser.rb +++ b/lib/laser/annotation_parser/useful_parsers_parser.rb @@ -671,4 +671,4 @@ class GeneralPurposeParser < Treetop::Runtime::CompiledParser end end -end \ No newline at end of file +end diff --git a/lib/laser/rake/task.rb b/lib/laser/rake/task.rb index b1899af..3556840 100644 --- a/lib/laser/rake/task.rb +++ b/lib/laser/rake/task.rb @@ -43,4 +43,4 @@ def run end end end -end \ No newline at end of file +end diff --git a/lib/laser/runner.rb b/lib/laser/runner.rb index 18a2fc3..b93d924 100644 --- a/lib/laser/runner.rb +++ b/lib/laser/runner.rb @@ -191,4 +191,4 @@ def display_warnings(warnings, settings) end end end -end \ No newline at end of file +end diff --git a/lib/laser/scanner.rb b/lib/laser/scanner.rb index 72950ec..ad49a9a 100644 --- a/lib/laser/scanner.rb +++ b/lib/laser/scanner.rb @@ -115,13 +115,17 @@ def check_for_indent_warnings!(line, filename) end def unused_method_warnings - Analysis::UnusedMethodDetection.unused_methods.map do |method| + Analysis::MethodAnalysis.unused_methods.map do |method| warning = UncalledMethodWarning.new(method.proc.ast_node.file_name, '', method: method) warning.line_number = method.proc.line_number warning end end + def method_expectation_warnings + + end + # Gets the current indent size def current_indent self.indent_stack.last || 0 @@ -166,4 +170,4 @@ def scan_for_warnings(warnings, content, filename) warnings.map { |warning| warning.generated_warnings(warning.body)}.flatten end end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/_thread.rb b/lib/laser/standard_library/_thread.rb index 25cf6f4..6511f79 100644 --- a/lib/laser/standard_library/_thread.rb +++ b/lib/laser/standard_library/_thread.rb @@ -107,4 +107,4 @@ def value def wakeup end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/basic_object.rb b/lib/laser/standard_library/basic_object.rb index 041cded..567ed5f 100644 --- a/lib/laser/standard_library/basic_object.rb +++ b/lib/laser/standard_library/basic_object.rb @@ -52,4 +52,4 @@ def singleton_method_removed(symbol) def singleton_method_undefined(symbol) end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/complex.rb b/lib/laser/standard_library/complex.rb index 003d551..4f77a5b 100644 --- a/lib/laser/standard_library/complex.rb +++ b/lib/laser/standard_library/complex.rb @@ -159,4 +159,4 @@ def to_r # raises: never def to_s end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/enumerable.rb b/lib/laser/standard_library/enumerable.rb index b5762cd..60abc42 100644 --- a/lib/laser/standard_library/enumerable.rb +++ b/lib/laser/standard_library/enumerable.rb @@ -175,4 +175,4 @@ def to_a # pure: true def zip(ary, *arys) end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/exceptions.rb b/lib/laser/standard_library/exceptions.rb index 56117b5..0bfee94 100644 --- a/lib/laser/standard_library/exceptions.rb +++ b/lib/laser/standard_library/exceptions.rb @@ -132,4 +132,4 @@ class StopIteration < IndexError class ThreadError < StandardError end class FiberError < StandardError -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/integer.rb b/lib/laser/standard_library/integer.rb index dcd8fa5..7594a51 100644 --- a/lib/laser/standard_library/integer.rb +++ b/lib/laser/standard_library/integer.rb @@ -120,4 +120,4 @@ def upto(max) end require 'fixnum' -require 'bignum' \ No newline at end of file +require 'bignum' diff --git a/lib/laser/standard_library/kernel.rb b/lib/laser/standard_library/kernel.rb index 8f266f3..f8b5d49 100644 --- a/lib/laser/standard_library/kernel.rb +++ b/lib/laser/standard_library/kernel.rb @@ -221,4 +221,4 @@ def block_given? # overload: Bignum= -> Fixnum= | Bignum= def rand(n=nil) end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/laser_magic.rb b/lib/laser/standard_library/laser_magic.rb index 865ad72..2757c8e 100644 --- a/lib/laser/standard_library/laser_magic.rb +++ b/lib/laser/standard_library/laser_magic.rb @@ -4,4 +4,4 @@ class LaserFakeBlock < Proc class LaserFakeNil < NilClass end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/numbers.rb b/lib/laser/standard_library/numbers.rb index 387a0d4..7ccf57e 100644 --- a/lib/laser/standard_library/numbers.rb +++ b/lib/laser/standard_library/numbers.rb @@ -189,4 +189,4 @@ def zero? require 'integer' require 'float' -require 'complex' \ No newline at end of file +require 'complex' diff --git a/lib/laser/standard_library/proc.rb b/lib/laser/standard_library/proc.rb index c8bbf2f..93f49b4 100644 --- a/lib/laser/standard_library/proc.rb +++ b/lib/laser/standard_library/proc.rb @@ -28,4 +28,4 @@ def to_proc # returns: empty def lexical_self=(val) end -end \ No newline at end of file +end diff --git a/lib/laser/standard_library/stringio.rb b/lib/laser/standard_library/stringio.rb index 2c39492..e419a15 100644 --- a/lib/laser/standard_library/stringio.rb +++ b/lib/laser/standard_library/stringio.rb @@ -1,2 +1,2 @@ class StringIO < Data -end \ No newline at end of file +end diff --git a/lib/laser/support/acts_as_struct.rb b/lib/laser/support/acts_as_struct.rb index 25524b4..900f717 100644 --- a/lib/laser/support/acts_as_struct.rb +++ b/lib/laser/support/acts_as_struct.rb @@ -63,4 +63,4 @@ def acts_as_struct(*members) end end end -end \ No newline at end of file +end diff --git a/lib/laser/support/frequency.rb b/lib/laser/support/frequency.rb index 4abcd9f..3ec8c79 100644 --- a/lib/laser/support/frequency.rb +++ b/lib/laser/support/frequency.rb @@ -52,4 +52,4 @@ class << self undef new end end -end \ No newline at end of file +end diff --git a/lib/laser/support/inheritable_attributes.rb b/lib/laser/support/inheritable_attributes.rb index 47e8e48..f97e7e8 100644 --- a/lib/laser/support/inheritable_attributes.rb +++ b/lib/laser/support/inheritable_attributes.rb @@ -142,4 +142,4 @@ def inherited_with_inheritable_attributes(child) end end end -end \ No newline at end of file +end diff --git a/lib/laser/support/module_extensions.rb b/lib/laser/support/module_extensions.rb index faf1f28..bdfa74e 100644 --- a/lib/laser/support/module_extensions.rb +++ b/lib/laser/support/module_extensions.rb @@ -91,4 +91,4 @@ def cattr_get_and_setter(*attrs) end end end -end \ No newline at end of file +end diff --git a/lib/laser/support/placeholder_object.rb b/lib/laser/support/placeholder_object.rb index db265a1..07b188a 100644 --- a/lib/laser/support/placeholder_object.rb +++ b/lib/laser/support/placeholder_object.rb @@ -10,4 +10,4 @@ def inspect end alias_method :to_s, :inspect end -end \ No newline at end of file +end diff --git a/lib/laser/third_party/rgl/depth_first_spanning_tree.rb b/lib/laser/third_party/rgl/depth_first_spanning_tree.rb index 427ce84..0710cd1 100644 --- a/lib/laser/third_party/rgl/depth_first_spanning_tree.rb +++ b/lib/laser/third_party/rgl/depth_first_spanning_tree.rb @@ -34,4 +34,4 @@ def build_dfst(tree, node, visited) end end end -end \ No newline at end of file +end diff --git a/lib/laser/third_party/rgl/dominators.rb b/lib/laser/third_party/rgl/dominators.rb index 04f98fb..3f4a3fc 100644 --- a/lib/laser/third_party/rgl/dominators.rb +++ b/lib/laser/third_party/rgl/dominators.rb @@ -121,4 +121,4 @@ def compute_post_order(graph, start_node) result end end -end \ No newline at end of file +end diff --git a/lib/laser/types/types.rb b/lib/laser/types/types.rb index 1d2cc2b..61ba79c 100644 --- a/lib/laser/types/types.rb +++ b/lib/laser/types/types.rb @@ -433,4 +433,4 @@ def raise_type_for_types(self_type, arg_types = [], block_type = nil) 'to_ary' => Types::ARRAY, '!' => Types::BOOLEAN } end -end \ No newline at end of file +end diff --git a/lib/laser/version.rb b/lib/laser/version.rb index 7acdbcc..06a5dee 100644 --- a/lib/laser/version.rb +++ b/lib/laser/version.rb @@ -11,4 +11,4 @@ module Version STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.') end end -end \ No newline at end of file +end diff --git a/lib/laser/warning.rb b/lib/laser/warning.rb index fb72bd8..f3345ca 100644 --- a/lib/laser/warning.rb +++ b/lib/laser/warning.rb @@ -148,4 +148,4 @@ def self.options Dir[File.expand_path(File.join(File.dirname(__FILE__), 'warnings', '**', '*.rb'))].each do |file| load file -end \ No newline at end of file +end diff --git a/lib/laser/warnings/assignment_in_condition.rb b/lib/laser/warnings/assignment_in_condition.rb index 0f4d964..27e127f 100644 --- a/lib/laser/warnings/assignment_in_condition.rb +++ b/lib/laser/warnings/assignment_in_condition.rb @@ -17,4 +17,4 @@ def match?(body = self.body) Laser::AssignmentInConditionWarning.new(file, body) end end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/comment_spacing.rb b/lib/laser/warnings/comment_spacing.rb index 4deb52b..4f7ab81 100644 --- a/lib/laser/warnings/comment_spacing.rb +++ b/lib/laser/warnings/comment_spacing.rb @@ -28,4 +28,4 @@ def fix def spacing @settings[OPTION_KEY] || DEFAULT_SPACE end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/extra_blank_lines.rb b/lib/laser/warnings/extra_blank_lines.rb index 24c3ae4..1e2d2a7 100644 --- a/lib/laser/warnings/extra_blank_lines.rb +++ b/lib/laser/warnings/extra_blank_lines.rb @@ -27,4 +27,4 @@ def count_extra_lines end count end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/extra_whitespace.rb b/lib/laser/warnings/extra_whitespace.rb index afb2645..3c03e6a 100644 --- a/lib/laser/warnings/extra_whitespace.rb +++ b/lib/laser/warnings/extra_whitespace.rb @@ -13,4 +13,4 @@ def match?(body = self.body) def fix self.line.gsub(/\s+$/, '') end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/hash_symbol_18_warning.rb b/lib/laser/warnings/hash_symbol_18_warning.rb index 2e6ccd3..4c02e18 100644 --- a/lib/laser/warnings/hash_symbol_18_warning.rb +++ b/lib/laser/warnings/hash_symbol_18_warning.rb @@ -60,4 +60,4 @@ def fix(body = self.body) end lines.join end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/hash_symbol_19_warning.rb b/lib/laser/warnings/hash_symbol_19_warning.rb index 2472a53..c492419 100644 --- a/lib/laser/warnings/hash_symbol_19_warning.rb +++ b/lib/laser/warnings/hash_symbol_19_warning.rb @@ -26,4 +26,4 @@ def fix(body = self.body) line_adjustments[label.line] += 3 # " =>" is inserted and is 3 chars lines.join end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/line_length.rb b/lib/laser/warnings/line_length.rb index 6e745a8..5bc1c80 100644 --- a/lib/laser/warnings/line_length.rb +++ b/lib/laser/warnings/line_length.rb @@ -112,4 +112,4 @@ def LineLengthWarning(size) (@table ||= {})[size] ||= LineLengthCustomSeverity(size, 3) end module_function :LineLengthMaximum, :LineLengthWarning, :LineLengthCustomSeverity -end \ No newline at end of file +end diff --git a/lib/laser/warnings/misaligned_unindentation.rb b/lib/laser/warnings/misaligned_unindentation.rb index f7297c2..5f5d77b 100644 --- a/lib/laser/warnings/misaligned_unindentation.rb +++ b/lib/laser/warnings/misaligned_unindentation.rb @@ -14,4 +14,4 @@ def initialize(file, line, expectation) def fix indent self.line, @expectation end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/operator_spacing.rb b/lib/laser/warnings/operator_spacing.rb index df347a1..ff1db92 100644 --- a/lib/laser/warnings/operator_spacing.rb +++ b/lib/laser/warnings/operator_spacing.rb @@ -65,4 +65,4 @@ def fix end line end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/parens_on_declaration.rb b/lib/laser/warnings/parens_on_declaration.rb index d4df300..cf4bc4e 100644 --- a/lib/laser/warnings/parens_on_declaration.rb +++ b/lib/laser/warnings/parens_on_declaration.rb @@ -27,4 +27,4 @@ def match?(body = self.body) end def_list + sdef_list end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/rescue_exception.rb b/lib/laser/warnings/rescue_exception.rb index 796a75a..181dd20 100644 --- a/lib/laser/warnings/rescue_exception.rb +++ b/lib/laser/warnings/rescue_exception.rb @@ -39,4 +39,4 @@ def fix(body = self.body) result << all_lines[position[0]+1..-1].join if position[0]+1 < all_lines.size result end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/semicolon.rb b/lib/laser/warnings/semicolon.rb index 01e31f2..a994cb0 100644 --- a/lib/laser/warnings/semicolon.rb +++ b/lib/laser/warnings/semicolon.rb @@ -22,4 +22,4 @@ def fix(line = self.body) right = fix(right[1..-1]) "#{indent left}\n#{indent right}" end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/sexp_errors.rb b/lib/laser/warnings/sexp_errors.rb index c986f27..d07e026 100644 --- a/lib/laser/warnings/sexp_errors.rb +++ b/lib/laser/warnings/sexp_errors.rb @@ -21,4 +21,4 @@ def match?(body = self.body) Laser::SexpErrorWarning.new(error.ast_node.file_name, body, error: error) end end -end \ No newline at end of file +end diff --git a/lib/laser/warnings/uncalled_method_warning.rb b/lib/laser/warnings/uncalled_method_warning.rb index 0a997f2..fb88f95 100644 --- a/lib/laser/warnings/uncalled_method_warning.rb +++ b/lib/laser/warnings/uncalled_method_warning.rb @@ -4,4 +4,4 @@ class Laser::UncalledMethodWarning < Laser::FileWarning short_desc "Unused method" desc { "The method #{method.owner.name}##{method.name} is never called." } setting_accessor :method -end \ No newline at end of file +end diff --git a/lib/laser/warnings/useless_double_quotes.rb b/lib/laser/warnings/useless_double_quotes.rb index 86af0ef..0962330 100644 --- a/lib/laser/warnings/useless_double_quotes.rb +++ b/lib/laser/warnings/useless_double_quotes.rb @@ -35,4 +35,4 @@ def fix(body = self.body) body.gsub("\"#{quoted_string}\"", "'#{quoted_string}'"). gsub("%Q{#{quoted_string}}", "%q{#{quoted_string}}") end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/annotations_spec.rb b/spec/analysis_specs/annotations_spec.rb index 4ca3ff6..5bb2751 100644 --- a/spec/analysis_specs/annotations_spec.rb +++ b/spec/analysis_specs/annotations_spec.rb @@ -44,4 +44,4 @@ def annotate!(node) sexp.children[3].childsize.should == 2 end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/annotations_specs/comment_attachment_spec.rb b/spec/analysis_specs/annotations_specs/comment_attachment_spec.rb index a42ff88..3ff27b3 100644 --- a/spec/analysis_specs/annotations_specs/comment_attachment_spec.rb +++ b/spec/analysis_specs/annotations_specs/comment_attachment_spec.rb @@ -65,4 +65,4 @@ def some_method(abc) assignment = defn[3][1][0] assignment.comment.body.should == " y: String" end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/annotations_specs/node_pointers_annotation_spec.rb b/spec/analysis_specs/annotations_specs/node_pointers_annotation_spec.rb index c85fcd9..c73c46a 100644 --- a/spec/analysis_specs/annotations_specs/node_pointers_annotation_spec.rb +++ b/spec/analysis_specs/annotations_specs/node_pointers_annotation_spec.rb @@ -87,4 +87,4 @@ node.next.prev.should == node if node.is_sexp?(node.next) end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/annotations_specs/runtime_annotation_spec.rb b/spec/analysis_specs/annotations_specs/runtime_annotation_spec.rb index f93e78b..a988019 100644 --- a/spec/analysis_specs/annotations_specs/runtime_annotation_spec.rb +++ b/spec/analysis_specs/annotations_specs/runtime_annotation_spec.rb @@ -132,4 +132,4 @@ defn = tree[1][0] expectalot(:runtime => { :run => defn[3].all_subtrees }) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/annotations_specs/spec_helper.rb b/spec/analysis_specs/annotations_specs/spec_helper.rb index 33a3e8a..220e97e 100644 --- a/spec/analysis_specs/annotations_specs/spec_helper.rb +++ b/spec/analysis_specs/annotations_specs/spec_helper.rb @@ -30,4 +30,4 @@ def expectalot(expectation) end end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/argument_expansion_spec.rb b/spec/analysis_specs/argument_expansion_spec.rb index e302dc4..d65bd53 100644 --- a/spec/analysis_specs/argument_expansion_spec.rb +++ b/spec/analysis_specs/argument_expansion_spec.rb @@ -110,4 +110,4 @@ expansion.constant_values.should == [:a, :b] end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/bindings_spec.rb b/spec/analysis_specs/bindings_spec.rb index 5fedaa9..79ec7b7 100644 --- a/spec/analysis_specs/bindings_spec.rb +++ b/spec/analysis_specs/bindings_spec.rb @@ -33,4 +33,4 @@ sym.value.should == 4 end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/comment_spec.rb b/spec/analysis_specs/comment_spec.rb index 637a74c..d7463a5 100644 --- a/spec/analysis_specs/comment_spec.rb +++ b/spec/analysis_specs/comment_spec.rb @@ -90,4 +90,4 @@ ] end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/cfg_instruction_spec.rb b/spec/analysis_specs/control_flow_specs/cfg_instruction_spec.rb index fcc78b7..8656e0c 100644 --- a/spec/analysis_specs/control_flow_specs/cfg_instruction_spec.rb +++ b/spec/analysis_specs/control_flow_specs/cfg_instruction_spec.rb @@ -108,4 +108,4 @@ operands.should == [] end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/constant_propagation_spec.rb b/spec/analysis_specs/control_flow_specs/constant_propagation_spec.rb index 6e6a6eb..e35cfe8 100644 --- a/spec/analysis_specs/control_flow_specs/constant_propagation_spec.rb +++ b/spec/analysis_specs/control_flow_specs/constant_propagation_spec.rb @@ -557,4 +557,4 @@ def foo_blockitized EOF g.should have_constant('z').with_value(['aa', 'bb', 'cc']) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/control_flow_graph_spec.rb b/spec/analysis_specs/control_flow_specs/control_flow_graph_spec.rb index fc0944a..e6a004f 100644 --- a/spec/analysis_specs/control_flow_specs/control_flow_graph_spec.rb +++ b/spec/analysis_specs/control_flow_specs/control_flow_graph_spec.rb @@ -2,4 +2,4 @@ describe ControlFlow::ControlFlowGraph do -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/improper_override_spec.rb b/spec/analysis_specs/control_flow_specs/improper_override_spec.rb index 73b302e..247c5ce 100644 --- a/spec/analysis_specs/control_flow_specs/improper_override_spec.rb +++ b/spec/analysis_specs/control_flow_specs/improper_override_spec.rb @@ -158,17 +158,20 @@ def ! have_error(ImproperOverrideTypeError)) end - it 'should warn when a method whose name ends in ? does not return a bool | nil' do + it 'should warn when a method whose name ends in ? does not return both truthy and falsy at some point' do cfg <<-EOF class OverI4 def silly?(x, y) - x == y && y # whoops, returns y's type. How about a boolean? + x end end EOF ClassRegistry["OverI4"].instance_method(:silly?). return_type_for_types( ClassRegistry["OverI4"].as_type, [Types::FIXNUM, Types::FIXNUM]) + ClassRegistry["OverI4"].instance_method(:silly?). + return_type_for_types( + ClassRegistry["OverI4"].as_type, [Types::STRING, Types::FIXNUM]) ClassRegistry["OverI4"].instance_method(:silly?).proc.ast_node.should( have_error(ImproperOverrideTypeError)) end @@ -273,4 +276,4 @@ def self.#{method}(*args) have_error(OverrideWithoutSuperError)) end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/raise_properties_spec.rb b/spec/analysis_specs/control_flow_specs/raise_properties_spec.rb index f0c1e0e..ed5eedf 100644 --- a/spec/analysis_specs/control_flow_specs/raise_properties_spec.rb +++ b/spec/analysis_specs/control_flow_specs/raise_properties_spec.rb @@ -310,4 +310,4 @@ def foo(*args) [Types::STRING, Types::FIXNUM, Types::BIGNUM, Types::ARRAY, Types::HASH]).should == Frequency::ALWAYS end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/raise_type_inference_spec.rb b/spec/analysis_specs/control_flow_specs/raise_type_inference_spec.rb index 13f09ca..a768106 100644 --- a/spec/analysis_specs/control_flow_specs/raise_type_inference_spec.rb +++ b/spec/analysis_specs/control_flow_specs/raise_type_inference_spec.rb @@ -298,4 +298,4 @@ def foo(*args) [Types::STRING, Types::FIXNUM, Types::BIGNUM, Types::ARRAY, Types::HASH]).should( equal_type(ClassRegistry['ArgumentError'].as_type)) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/return_type_inference_spec.rb b/spec/analysis_specs/control_flow_specs/return_type_inference_spec.rb index 15a24e2..17b0384 100644 --- a/spec/analysis_specs/control_flow_specs/return_type_inference_spec.rb +++ b/spec/analysis_specs/control_flow_specs/return_type_inference_spec.rb @@ -413,4 +413,4 @@ def foo(x) Types::FIXNUM, ClassRegistry['Symbol'].as_type, Types::FIXNUM, ClassRegistry['Symbol'].as_type])) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/simulation_spec.rb b/spec/analysis_specs/control_flow_specs/simulation_spec.rb index 7a06d27..582cc62 100644 --- a/spec/analysis_specs/control_flow_specs/simulation_spec.rb +++ b/spec/analysis_specs/control_flow_specs/simulation_spec.rb @@ -155,4 +155,4 @@ def foo(x) # tree.all_errors.first.should be_a(TopLevelSimulationRaised) # tree.all_errors.first.error.should be_a(ControlFlow::Simulation::SimulationNonterminationError) # end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/spec_helper.rb b/spec/analysis_specs/control_flow_specs/spec_helper.rb index 4bc83fb..1e6a431 100644 --- a/spec/analysis_specs/control_flow_specs/spec_helper.rb +++ b/spec/analysis_specs/control_flow_specs/spec_helper.rb @@ -107,4 +107,4 @@ def cfg_method(input) graph = cfg_builder.build graph.analyze graph -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/tuple_misuse_inference_spec.rb b/spec/analysis_specs/control_flow_specs/tuple_misuse_inference_spec.rb index 7c815af..1b49a58 100644 --- a/spec/analysis_specs/control_flow_specs/tuple_misuse_inference_spec.rb +++ b/spec/analysis_specs/control_flow_specs/tuple_misuse_inference_spec.rb @@ -122,4 +122,4 @@ def bar(x) EOF g.should have_error(Laser::UnassignedLHSError).on_line(3) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/unreachability_analysis_spec.rb b/spec/analysis_specs/control_flow_specs/unreachability_analysis_spec.rb index 7ec1c5b..12e672a 100644 --- a/spec/analysis_specs/control_flow_specs/unreachability_analysis_spec.rb +++ b/spec/analysis_specs/control_flow_specs/unreachability_analysis_spec.rb @@ -80,4 +80,4 @@ def foo EOF g.should have_error(Laser::DeadCodeWarning).on_line(6) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/unused_variable_spec.rb b/spec/analysis_specs/control_flow_specs/unused_variable_spec.rb index 964043b..f19774a 100644 --- a/spec/analysis_specs/control_flow_specs/unused_variable_spec.rb +++ b/spec/analysis_specs/control_flow_specs/unused_variable_spec.rb @@ -106,4 +106,4 @@ def foo(x) g.should have_error(Laser::UnusedVariableWarning).on_line(3).with_message(/\b i \b/x) g.should have_error(Laser::UnusedVariableWarning).on_line(4).with_message(/\b c \b/x) end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/control_flow_specs/yield_properties_spec.rb b/spec/analysis_specs/control_flow_specs/yield_properties_spec.rb index 0b871e9..09e5fff 100644 --- a/spec/analysis_specs/control_flow_specs/yield_properties_spec.rb +++ b/spec/analysis_specs/control_flow_specs/yield_properties_spec.rb @@ -381,4 +381,4 @@ def each method = ClassRegistry['YP10'].instance_method(:each) method.yield_type.should be :optional end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/error_spec.rb b/spec/analysis_specs/error_spec.rb index 48b7c6c..635a60b 100644 --- a/spec/analysis_specs/error_spec.rb +++ b/spec/analysis_specs/error_spec.rb @@ -27,4 +27,4 @@ result.severity.should == 3 end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/laser_class_spec.rb b/spec/analysis_specs/laser_class_spec.rb index 99878be..ec9244d 100644 --- a/spec/analysis_specs/laser_class_spec.rb +++ b/spec/analysis_specs/laser_class_spec.rb @@ -319,4 +319,4 @@ @method.name.should == 'foobar' end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/lexical_analysis_spec.rb b/spec/analysis_specs/lexical_analysis_spec.rb index ac0b66d..c7ec3c7 100644 --- a/spec/analysis_specs/lexical_analysis_spec.rb +++ b/spec/analysis_specs/lexical_analysis_spec.rb @@ -181,4 +181,4 @@ def initialize(body) right.should == 'unless y == 2' end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/protocol_registry_spec.rb b/spec/analysis_specs/protocol_registry_spec.rb index 72380f9..e3bb6c4 100644 --- a/spec/analysis_specs/protocol_registry_spec.rb +++ b/spec/analysis_specs/protocol_registry_spec.rb @@ -60,4 +60,4 @@ ClassRegistry['Class'].superclass.should == ClassRegistry['Module'] end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/scope_annotation_spec.rb b/spec/analysis_specs/scope_annotation_spec.rb index f69b90b..57b1c03 100644 --- a/spec/analysis_specs/scope_annotation_spec.rb +++ b/spec/analysis_specs/scope_annotation_spec.rb @@ -1010,4 +1010,4 @@ def initialize(name, value, kind, default_value = nil) arg_binding.instance_method(:initialize).arity.should == (3..4) end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/scope_spec.rb b/spec/analysis_specs/scope_spec.rb index 0eab324..bd6044c 100644 --- a/spec/analysis_specs/scope_spec.rb +++ b/spec/analysis_specs/scope_spec.rb @@ -123,4 +123,4 @@ def add_scope_instance_variables(klass) }.to raise_error(Scope::ScopeLookupFailure) end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/sexp_analysis_spec.rb b/spec/analysis_specs/sexp_analysis_spec.rb index 23bf700..61675f3 100644 --- a/spec/analysis_specs/sexp_analysis_spec.rb +++ b/spec/analysis_specs/sexp_analysis_spec.rb @@ -30,4 +30,4 @@ def file @class.new('a + b').find_sexps(:rescue).should be_empty end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/sexp_extension_specs/constant_extraction_spec.rb b/spec/analysis_specs/sexp_extension_specs/constant_extraction_spec.rb index 78af545..d8769a3 100644 --- a/spec/analysis_specs/sexp_extension_specs/constant_extraction_spec.rb +++ b/spec/analysis_specs/sexp_extension_specs/constant_extraction_spec.rb @@ -306,4 +306,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/sexp_extension_specs/source_location_spec.rb b/spec/analysis_specs/sexp_extension_specs/source_location_spec.rb index 4f24774..c682936 100644 --- a/spec/analysis_specs/sexp_extension_specs/source_location_spec.rb +++ b/spec/analysis_specs/sexp_extension_specs/source_location_spec.rb @@ -228,4 +228,4 @@ klass[3][1][0].source_begin.should == [2, 9] end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/sexp_extension_specs/spec_helper.rb b/spec/analysis_specs/sexp_extension_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/analysis_specs/sexp_extension_specs/spec_helper.rb +++ b/spec/analysis_specs/sexp_extension_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/analysis_specs/sexp_extension_specs/type_inference_spec.rb b/spec/analysis_specs/sexp_extension_specs/type_inference_spec.rb index af60144..22f2991 100644 --- a/spec/analysis_specs/sexp_extension_specs/type_inference_spec.rb +++ b/spec/analysis_specs/sexp_extension_specs/type_inference_spec.rb @@ -249,4 +249,4 @@ list[0][2].expr_type.should == Types::ClassType.new('Proc', :invariant) end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/sexp_spec.rb b/spec/analysis_specs/sexp_spec.rb index e50250c..0807a6d 100644 --- a/spec/analysis_specs/sexp_spec.rb +++ b/spec/analysis_specs/sexp_spec.rb @@ -164,4 +164,4 @@ assign[2].expanded_identifier.should == '::DEF::XYZ' end end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/spec_helper.rb b/spec/analysis_specs/spec_helper.rb index 1a1d58d..f39e55d 100644 --- a/spec/analysis_specs/spec_helper.rb +++ b/spec/analysis_specs/spec_helper.rb @@ -24,4 +24,4 @@ def clean_registry def annotate_all(body) Annotations.annotate_inputs([['(stdin)', body]]).first[1] -end \ No newline at end of file +end diff --git a/spec/analysis_specs/unused_methods_spec.rb b/spec/analysis_specs/unused_methods_spec.rb index 5bea700..b285e0e 100644 --- a/spec/analysis_specs/unused_methods_spec.rb +++ b/spec/analysis_specs/unused_methods_spec.rb @@ -1,6 +1,6 @@ require_relative 'spec_helper' -describe UnusedMethodDetection do +describe MethodAnalysis do before(:all) do Laser::Analysis::LaserMethod.default_dispatched = false end @@ -30,7 +30,7 @@ def baz end UnusedMethod1.new.foo(gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods @methods.should == [ClassRegistry['UnusedMethod1'].instance_method(:baz)] end @@ -56,7 +56,7 @@ def baz end UnusedMethod3.new.foo(gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod2'].instance_method(:foo), @@ -78,7 +78,7 @@ def baz(a, b, *rest) inst.foo(gets) # marks foo as used inst.baz(gets, gets, gets, gets, gets) # marks baz, but not bar EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod4'].instance_method(:bar)] @@ -101,7 +101,7 @@ def any(*rest) choice = [:zero, :one_or_two, :two, :three, :any][gets.to_i] UnusedMethod5.new.send(choice, gets, gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod5'].instance_method(:zero), @@ -126,7 +126,7 @@ def protected_two(a, b) :private_two, :protected_two][gets.to_i] UnusedMethod6.new.public_send(choice, gets, gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod6'].instance_method(:private_two), @@ -149,7 +149,7 @@ def any(*rest) end UnusedMethod7.new.send(gets, gets, gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod7'].instance_method(:three)] @@ -171,10 +171,10 @@ def protected_two(a, b) end UnusedMethod8.new.public_send(gets, gets, gets) EOF - @methods = UnusedMethodDetection.unused_methods + @methods = MethodAnalysis.unused_methods Set.new(@methods).should == Set[ClassRegistry['UnusedMethod8'].instance_method(:private_two), ClassRegistry['UnusedMethod8'].instance_method(:protected_two)] end -end \ No newline at end of file +end diff --git a/spec/analysis_specs/visitor_spec.rb b/spec/analysis_specs/visitor_spec.rb index 19ca21d..2811cba 100644 --- a/spec/analysis_specs/visitor_spec.rb +++ b/spec/analysis_specs/visitor_spec.rb @@ -61,4 +61,4 @@ def default_visit(node) klass.new.visit(a) end end -end \ No newline at end of file +end diff --git a/spec/annotation_parser_specs/annotations_parser_spec.rb b/spec/annotation_parser_specs/annotations_parser_spec.rb index b55f015..98cc704 100644 --- a/spec/annotation_parser_specs/annotations_parser_spec.rb +++ b/spec/annotation_parser_specs/annotations_parser_spec.rb @@ -86,4 +86,4 @@ result.should_not be_type end end -end \ No newline at end of file +end diff --git a/spec/annotation_parser_specs/class_annotation_parser_spec.rb b/spec/annotation_parser_specs/class_annotation_parser_spec.rb index 06b00a6..b5a6ab4 100644 --- a/spec/annotation_parser_specs/class_annotation_parser_spec.rb +++ b/spec/annotation_parser_specs/class_annotation_parser_spec.rb @@ -117,4 +117,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/annotation_parser_specs/overload_parser_spec.rb b/spec/annotation_parser_specs/overload_parser_spec.rb index 1c65c03..da9076e 100644 --- a/spec/annotation_parser_specs/overload_parser_spec.rb +++ b/spec/annotation_parser_specs/overload_parser_spec.rb @@ -36,4 +36,4 @@ Types::UnionType.new([Types::FLOAT, Types::NILCLASS])])) end end -end \ No newline at end of file +end diff --git a/spec/annotation_parser_specs/parsers_spec.rb b/spec/annotation_parser_specs/parsers_spec.rb index 0e72c7f..ad287df 100644 --- a/spec/annotation_parser_specs/parsers_spec.rb +++ b/spec/annotation_parser_specs/parsers_spec.rb @@ -11,4 +11,4 @@ Parsers::ClassParser != nil end end -end \ No newline at end of file +end diff --git a/spec/annotation_parser_specs/spec_helper.rb b/spec/annotation_parser_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/annotation_parser_specs/spec_helper.rb +++ b/spec/annotation_parser_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/annotation_parser_specs/structural_parser_spec.rb b/spec/annotation_parser_specs/structural_parser_spec.rb index 37f5233..ae16aaa 100644 --- a/spec/annotation_parser_specs/structural_parser_spec.rb +++ b/spec/annotation_parser_specs/structural_parser_spec.rb @@ -64,4 +64,4 @@ '#write'.should parse_to(Types::StructuralType.new('write', [], [])) end end -end \ No newline at end of file +end diff --git a/spec/laser_spec.rb b/spec/laser_spec.rb index a0375b2..6f80e24 100644 --- a/spec/laser_spec.rb +++ b/spec/laser_spec.rb @@ -11,4 +11,4 @@ TESTS_ACTIVATED.should be true end end -end \ No newline at end of file +end diff --git a/spec/rake_specs/spec_helper.rb b/spec/rake_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/rake_specs/spec_helper.rb +++ b/spec/rake_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/rake_specs/task_spec.rb b/spec/rake_specs/task_spec.rb index 7eda46f..a077583 100644 --- a/spec/rake_specs/task_spec.rb +++ b/spec/rake_specs/task_spec.rb @@ -64,4 +64,4 @@ printout.should =~ /1 are fixable/ end end -end \ No newline at end of file +end diff --git a/spec/runner_spec.rb b/spec/runner_spec.rb index 9a80f33..4a08c14 100644 --- a/spec/runner_spec.rb +++ b/spec/runner_spec.rb @@ -206,4 +206,4 @@ @runner.collect_warnings(['abc', 'def'], scanner).should == [warning_list1, warning_list2] end end -end \ No newline at end of file +end diff --git a/spec/scanner_spec.rb b/spec/scanner_spec.rb index 46850d6..8edeb04 100644 --- a/spec/scanner_spec.rb +++ b/spec/scanner_spec.rb @@ -72,4 +72,4 @@ @fix_scanner_stdout.string.should == "class Hello\n 1 + 2\nend" end end -end \ No newline at end of file +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e5c3d52..4e5432f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -118,4 +118,4 @@ def swizzling_stdin return $stdin.string ensure $stdin = old_stdin -end \ No newline at end of file +end diff --git a/spec/standard_library/exceptions_spec.rb b/spec/standard_library/exceptions_spec.rb index 6d364da..3aec883 100644 --- a/spec/standard_library/exceptions_spec.rb +++ b/spec/standard_library/exceptions_spec.rb @@ -16,4 +16,4 @@ klass.superset.should include(ClassRegistry['Exception']) end end -end \ No newline at end of file +end diff --git a/spec/standard_library/globals_spec.rb b/spec/standard_library/globals_spec.rb index d950c49..5513860 100644 --- a/spec/standard_library/globals_spec.rb +++ b/spec/standard_library/globals_spec.rb @@ -11,4 +11,4 @@ File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'laser', 'standard_library'))) end end -end \ No newline at end of file +end diff --git a/spec/standard_library/set_spec.rb b/spec/standard_library/set_spec.rb index 5f38663..9b6a4c6 100644 --- a/spec/standard_library/set_spec.rb +++ b/spec/standard_library/set_spec.rb @@ -28,4 +28,4 @@ ClassRegistry['Set'].instance_method(method).should_not be_nil end end -end \ No newline at end of file +end diff --git a/spec/standard_library/spec_helper.rb b/spec/standard_library/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/standard_library/spec_helper.rb +++ b/spec/standard_library/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/standard_library/standard_library_spec.rb b/spec/standard_library/standard_library_spec.rb index 345ff61..b88a11a 100644 --- a/spec/standard_library/standard_library_spec.rb +++ b/spec/standard_library/standard_library_spec.rb @@ -299,4 +299,4 @@ it_should_behave_like 'a class' end -end \ No newline at end of file +end diff --git a/spec/support_specs/acts_as_struct_spec.rb b/spec/support_specs/acts_as_struct_spec.rb index 2a6e185..cac55fd 100644 --- a/spec/support_specs/acts_as_struct_spec.rb +++ b/spec/support_specs/acts_as_struct_spec.rb @@ -91,4 +91,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/support_specs/frequency_spec.rb b/spec/support_specs/frequency_spec.rb index 0303208..b12ac53 100644 --- a/spec/support_specs/frequency_spec.rb +++ b/spec/support_specs/frequency_spec.rb @@ -20,4 +20,4 @@ end it { Frequency.should_not respond_to(:new) } -end \ No newline at end of file +end diff --git a/spec/support_specs/module_extensions_spec.rb b/spec/support_specs/module_extensions_spec.rb index 3d2491d..0d50f61 100644 --- a/spec/support_specs/module_extensions_spec.rb +++ b/spec/support_specs/module_extensions_spec.rb @@ -114,4 +114,4 @@ def even?(x) @class.new.odd?(1).should be true end end -end \ No newline at end of file +end diff --git a/spec/support_specs/spec_helper.rb b/spec/support_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/support_specs/spec_helper.rb +++ b/spec/support_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/type_specs/spec_helper.rb b/spec/type_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/type_specs/spec_helper.rb +++ b/spec/type_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/type_specs/types_spec.rb b/spec/type_specs/types_spec.rb index b2cc7da..c4878c9 100644 --- a/spec/type_specs/types_spec.rb +++ b/spec/type_specs/types_spec.rb @@ -130,4 +130,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/warning_spec.rb b/spec/warning_spec.rb index 8be2e8d..9b40f9e 100644 --- a/spec/warning_spec.rb +++ b/spec/warning_spec.rb @@ -92,4 +92,4 @@ def self.set_type klass.short_name.should =~ /SI\d/ end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/assignment_in_condition_spec.rb b/spec/warning_specs/assignment_in_condition_spec.rb index abc677f..16ca3fe 100644 --- a/spec/warning_specs/assignment_in_condition_spec.rb +++ b/spec/warning_specs/assignment_in_condition_spec.rb @@ -65,4 +65,4 @@ # matches[0].desc.should =~ /silly_monkey/ # end # end -end \ No newline at end of file +end diff --git a/spec/warning_specs/comment_spacing_spec.rb b/spec/warning_specs/comment_spacing_spec.rb index 09c65e3..86153ba 100644 --- a/spec/warning_specs/comment_spacing_spec.rb +++ b/spec/warning_specs/comment_spacing_spec.rb @@ -62,4 +62,4 @@ @output = 'a + b#comment' end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/extra_blank_lines_spec.rb b/spec/warning_specs/extra_blank_lines_spec.rb index e1d5757..2ee908a 100644 --- a/spec/warning_specs/extra_blank_lines_spec.rb +++ b/spec/warning_specs/extra_blank_lines_spec.rb @@ -67,4 +67,4 @@ def desc ExtraBlankLinesWarning.should correct_to(@invalid, @original) end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/extra_whitespace_spec.rb b/spec/warning_specs/extra_whitespace_spec.rb index ce9260c..861fde5 100644 --- a/spec/warning_specs/extra_whitespace_spec.rb +++ b/spec/warning_specs/extra_whitespace_spec.rb @@ -30,4 +30,4 @@ ExtraWhitespaceWarning.should correct_to("a + b\t\t", 'a + b') end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/hash_symbol_18_warning_spec.rb b/spec/warning_specs/hash_symbol_18_warning_spec.rb index 3ff5519..d400ab6 100644 --- a/spec/warning_specs/hash_symbol_18_warning_spec.rb +++ b/spec/warning_specs/hash_symbol_18_warning_spec.rb @@ -86,4 +86,4 @@ end.should == output end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/hash_symbol_19_warning_spec.rb b/spec/warning_specs/hash_symbol_19_warning_spec.rb index ea1d370..9c717b7 100644 --- a/spec/warning_specs/hash_symbol_19_warning_spec.rb +++ b/spec/warning_specs/hash_symbol_19_warning_spec.rb @@ -60,4 +60,4 @@ end.should == output end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/line_length_spec.rb b/spec/warning_specs/line_length_spec.rb index 46303be..324c5b3 100644 --- a/spec/warning_specs/line_length_spec.rb +++ b/spec/warning_specs/line_length_spec.rb @@ -170,4 +170,4 @@ it 'does not match lines smaller than the specified maximum' do @hundred_cap.should_not warn('x' * 80) end -end \ No newline at end of file +end diff --git a/spec/warning_specs/misaligned_unindentation_spec.rb b/spec/warning_specs/misaligned_unindentation_spec.rb index 07d5af1..159865a 100644 --- a/spec/warning_specs/misaligned_unindentation_spec.rb +++ b/spec/warning_specs/misaligned_unindentation_spec.rb @@ -32,4 +32,4 @@ other_warning.desc.should =~ /found 1/ end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/operator_spacing_spec.rb b/spec/warning_specs/operator_spacing_spec.rb index 128b5c8..2ccad87 100644 --- a/spec/warning_specs/operator_spacing_spec.rb +++ b/spec/warning_specs/operator_spacing_spec.rb @@ -101,4 +101,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/parens_on_declaration_spec.rb b/spec/warning_specs/parens_on_declaration_spec.rb index fcbf0a9..f6050d3 100644 --- a/spec/warning_specs/parens_on_declaration_spec.rb +++ b/spec/warning_specs/parens_on_declaration_spec.rb @@ -54,4 +54,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/rescue_exception_spec.rb b/spec/warning_specs/rescue_exception_spec.rb index fdf14d0..185408e 100644 --- a/spec/warning_specs/rescue_exception_spec.rb +++ b/spec/warning_specs/rescue_exception_spec.rb @@ -102,4 +102,4 @@ RescueExceptionWarning.new('(stdin)', input).match?(input).first.fix.should == output end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/semicolon_spec.rb b/spec/warning_specs/semicolon_spec.rb index 3bcaa3a..1252bec 100644 --- a/spec/warning_specs/semicolon_spec.rb +++ b/spec/warning_specs/semicolon_spec.rb @@ -55,4 +55,4 @@ SemicolonWarning.should correct_to(' a;b;c', " a\n b\n c") end end -end \ No newline at end of file +end diff --git a/spec/warning_specs/spec_helper.rb b/spec/warning_specs/spec_helper.rb index 291aa3e..935238d 100644 --- a/spec/warning_specs/spec_helper.rb +++ b/spec/warning_specs/spec_helper.rb @@ -1 +1 @@ -require_relative '../spec_helper' \ No newline at end of file +require_relative '../spec_helper' diff --git a/spec/warning_specs/useless_double_quotes_spec.rb b/spec/warning_specs/useless_double_quotes_spec.rb index 3ea3f0d..8f1fb6d 100644 --- a/spec/warning_specs/useless_double_quotes_spec.rb +++ b/spec/warning_specs/useless_double_quotes_spec.rb @@ -71,4 +71,4 @@ warnings.first.fix('simple "example, #{h "guy"} okay?"').should == 'simple "example, #{h \'guy\'} okay?"' end end -end \ No newline at end of file +end