cedadev / checksit

File-checking made simple
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

How to implement "one-of" and "one-or-more-of" #3

Open agstephens opened 2 years ago

agstephens commented 2 years ago

@rule:one-of: vocabs:ukcp18:variables

@rule:one-or-more: vocabs:ukcp18:variables

agstephens commented 2 years ago

Implemented, by example:

etc/checksit.ini:

[settings]
rule_splitters = |

--

$ checksit check 
  -r global_attributes:project=rule-func:match-one-of:"ukcp18|ukcp09",\ 
      global_attributes:contact=rule-func:match-one-or-more-of:"ukcpproject@metoffice.gov.uk|UKCP Team|MOHC"  \
/gws/nopw/j04/cmip6_prep_vol1/ukcp18/data/land-prob/v20211110/uk/25km/rcp85/sample/b8110/30y/cltAnom/mon/v20211110/cltAnom_rcp85_land-prob_uk_25km_sample_b8110_30y_mon_20091201-20991130.nc

NOTE: There is a need to not use commas, because the rules are split on commas. NOTE: There is a need to use speech marks if spaces exist.