Class: Yard::Lint::Validators::Documentation::UndocumentedBooleanMethods::Validator
- Inherits:
-
Base
- Object
- Base
- Yard::Lint::Validators::Documentation::UndocumentedBooleanMethods::Validator
- Defined in:
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/validator.rb
Overview
Runs a query that will pick all the boolean methods (ending with ?) that do not have a return type or return description documented
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#in_process_query(object, collector) ⇒ void
Execute query for a single object during in-process execution.
Methods inherited from Base
in_process, in_process?, in_process_visibility, #initialize, validator_name
Constructor Details
This class inherits a constructor from Yard::Lint::Validators::Base
Instance Method Details
#in_process_query(object, collector) ⇒ void
This method returns an undefined value.
Execute query for a single object during in-process execution. Finds boolean methods (ending with ?) without @return tag or return types.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yard/lint/validators/documentation/undocumented_boolean_methods/validator.rb', line 19 def in_process_query(object, collector) # Only check methods return unless object.type == :method # Skip aliases and implicit methods return if object.is_alias? return unless object.is_explicit? # Only check boolean methods (ending with ?) return unless object.name.to_s.end_with?('?') # Check if @return tag is missing or has no types return_tag = object.tag(:return) return unless return_tag.nil? || return_tag.types.to_a.empty? collector.puts "#{object.file}:#{object.line}: #{object.title}" end |