Class: Yard::Lint::Validators::Documentation::UndocumentedMethodArguments::Validator
- Inherits:
-
Base
- Object
- Base
- Yard::Lint::Validators::Documentation::UndocumentedMethodArguments::Validator
- Defined in:
- lib/yard/lint/validators/documentation/undocumented_method_arguments/validator.rb
Overview
Runs yard list to check for missing args docs on methods that were 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 methods where parameters.size > @param tags count.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/yard/lint/validators/documentation/undocumented_method_arguments/validator.rb', line 18 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? return if parent_class_allowed?(object) return if method_allowed?(object) # Skip attribute methods (@!attribute directive) - their setter parameter # doesn't need explicit @param documentation, matching attr_accessor behavior return if object.is_attribute? # Splat (*args, **opts) and block (&block) parameters are excluded - # blocks are documented with @yield rather than @param, matching the # arity convention used everywhere else in the gem (e.g. method_allowed?). params = object.parameters.reject { |p| p[0].to_s.start_with?('*', '&') } return if params.empty? # Opt-in: defer fully-undocumented methods to # Documentation/UndocumentedObjects instead of reporting them here too. return if config_or_default('SkipFullyUndocumented') && object.docstring.blank? return unless arguments_missing_docs?(object, params) collector.puts "#{object.file}:#{object.line}: #{object.title}" end |