NAME

App::Project::Doctor::Check::License - Check LICENSE file presence and META agreement

DESCRIPTION

Verifies a LICENSE/LICENCE file exists. When a META file is available, cross-checks the file content against the declared license identifier.

MESSAGES

Code | Trigger                       | Resolution
-----|-------------------------------|------------------------------------------
L001 | LICENSE file absent           | Add a LICENSE file matching your META value
L002 | LICENSE content != META value | Align file with declared license

FORMAL SPECIFICATION

check : Context -> [Finding]
check ctx ==
  let has_lic  = exists LICENSE in ctx
      mismatch = has_lic /\ (meta_lic /= undef) /\ not (content matches meta_lic)
  in  (if not has_lic then [error] else [])
      ++ (if mismatch  then [warning] else [])
      ++ (if has_lic /\ not mismatch 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.