NAME

App::Project::Doctor::Check::Meta - Check META file presence and validity

DESCRIPTION

Uses CPAN::Meta to parse the distribution META file and verifies that all required fields (name, version, author, abstract, license) are present.

METHODS

check( $context )

Locates the first available META file, parses it, and validates required fields.

API SPECIFICATION

Input

$context : App::Project::Doctor::Context

Output

List of App::Project::Doctor::Finding --
  warning         when no META.* file is found (builder file present),
  warning + error when no META.* and no builder file found,
  error           when the META file cannot be parsed,
  one error per missing required field (name/version/author/abstract/license),
  pass            when all required fields are present.

MESSAGES

Code | Trigger                     | Resolution
-----|-----------------------------|-----------------------------------------
M001 | No META.* file found        | Run builder to generate (make or dzil)
M002 | META parse failure          | Correct malformed YAML/JSON by hand
M003 | Required META field missing | Add field to Makefile.PL / dist.ini

FORMAL SPECIFICATION

check : Context -> [Finding]
check ctx ==
  let f = first meta_file existing in ctx
  in  if f = undef then [warning] ++ (if no builder then [error] else [])
      else let m = parse f
           in  if parse_fails then [error]
               else [error per missing field] ++ (if all ok then [pass] else [])

AUTHOR

Nigel Horne <njh@nigelhorne.com>

LICENSE

Copyright (C) 2026 Nigel Horne. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.