| 1 | package Dist::Conformance::Check::ClaudeMd 0.006; | ||||||||||||
| 2 | |||||||||||||
| 3 | # ABSTRACT: CLAUDE.md exists and names the skills that it must | ||||||||||||
| 4 | |||||||||||||
| 5 | 1 | ▶ | use 5.040; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use re '/aasx'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use Mojo::Base 'Dist::Conformance::Check', -signatures; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 1 | ▶ | use Dist::Conformance::Schema(); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub config_schema ($) { | ||||||||||
|
Subroutine
config_schema: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 14 | return { | ||||||||||||
| 15 | 0 | required => [qw{file mentions}], | |||||||||||
| 16 | properties => { | ||||||||||||
| 17 | file => $Dist::Conformance::Schema::PATH, | ||||||||||||
| 18 | mentions => { type => 'array', items => { type => 'string', minLength => 1 } }, | ||||||||||||
| 19 | template => $Dist::Conformance::Schema::PATH, | ||||||||||||
| 20 | }, | ||||||||||||
| 21 | }; | ||||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | |||||||||||||
| 25 | 0 | ▶ | sub check ( $self, $snapshot ) { | ||||||||||
|
Subroutine
check: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 26 | 0 | my ( $file, $mentions ) = @{ $self->config }{qw{file mentions}}; | |||||||||||
| 27 | 0 | ▶ | my $text = $snapshot->content($file) // return ( 'fail', "$file is missing" ); | ||||||||||
|
Condition0%0/2
$snapshot->content($file) // (return "fail", "$file is missing")
MC/DC0%0/1
$snapshot->content($file) // (return "fail", "$file is missing")
$snapshot->content($file)
Truth table0%0/2
A
A= $snapshot->content($file)
| |||||||||||||
| 28 | 0 | my @absent = grep { index( $text, $_ ) < 0 } @$mentions; | |||||||||||
| 29 | 0 | ▶ | return ( 'fail', "$file does not name " . join ', ', @absent ) if @absent; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | ▶ | return ( 'pass', @$mentions ? 'names ' . join ', ', @$mentions : "$file exists" ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | |||||||||||||
| 34 | 0 | ▶ | sub update ( $self, $update ) { | ||||||||||
|
Subroutine
update: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 35 | 0 | my ( $status, $detail ) = $self->check( $update->snapshot ); | |||||||||||
| 36 | 0 | ▶ | return if $status ne 'fail'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 37 | 0 | ▶ | my $start = defined $self->config->{template} ? ', starting from ' . $self->config->{template} : q{}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 0 | $update->by_hand("$detail: write it by hand$start, because its prose cannot be generated"); | |||||||||||
| 39 | 0 | return; | |||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | __END__ | ||||||||||||