Subject: | add sanity check for Regexp in 'checks' |
Keeping 'fields' in sync with 'checks' manually is error-prone, so feature like {autofields=>1} is good idea. But it makes sense to improve it a little.
When bug 84959 will be fixed, only reason to manually add field names into 'fields' will be for fields which matched using Regexp only in 'checks'. So, it makes sense to add extra sanity check when Regexp in 'checks' are used:
- make sure 'fields' is manually defined
- make sure every Regexp in 'checks' match at least _two_ elements in 'fields' (if there are less than two params - why use Regexp?)
It doesn't guarantee all fields are listed, and may require adding fake items in 'fields' just to match these Regexps in corner cases, but it should help catch some errors.