Sah/SchemaR/unix/groupname.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 8 / 8 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« Sah/SchemaR/unix/gid/exists.pm ↑ Summary Sah/SchemaR/unix/groupname/exists.pm »
1 ## no critic: TestingAndDebugging::RequireStrict
2 package Sah::SchemaR::unix::groupname;
3  
4 1 our $DATE = '2024-11-15'; # DATE
5 1 our $VERSION = '0.022'; # VERSION
6  
7 1 our $rschema = do{my$var={base=>"str",clsets_after_base=>[{description=>"\nThe checking follows POSIX rules: does not begin with a hyphen and only contains\n[A-Za-z0-9._-].\n\nThe above rule allows integers like 1234, which can be confused with GID, so\nthis schema disallows pure integers.\n\nThe maximum length is 32 following libc6's limit.\n\nNote that this schema does not check whether the group name exists (has record\nin the user database e.g. `/etc/group`). To do that, use the\n`unix::groupname::exists` schema.\n\n",examples=>[{valid=>0,value=>""},{valid=>1,value=>"foo"},{valid=>0,value=>"-andy"},{valid=>0,value=>1234},{valid=>1,value=>"andy2"},{valid=>0,value=>"an dy"},{valid=>1,value=>"an.dy"},{summary=>"Too long",valid=>0,value=>"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}],match=>qr((?=\A[A-Za-z0-9._][A-Za-z0-9._-]{0,31}\z)(?=.*[A-Za-z._-])),max_len=>32,min_len=>1,prefilters=>["Unix::convert_gid_to_unix_group"],summary=>"Unix group name","x.completion"=>["unix_group_or_gid"]}],clsets_after_type=>['$var->{clsets_after_base}[0]'],"clsets_after_type.alt.merge.merged"=>['$var->{clsets_after_base}[0]'],resolve_path=>["str"],type=>"str",v=>2};$var->{clsets_after_type}[0]=$var->{clsets_after_base}[0];$var->{"clsets_after_type.alt.merge.merged"}[0]=$var->{clsets_after_base}[0];$var};
8  
9 1 1;
10 # ABSTRACT: Unix group name
11  
12 __END__
« Sah/SchemaR/unix/gid/exists.pm ↑ Summary Sah/SchemaR/unix/groupname/exists.pm »