Repository navigation
Skip criteria with unusable JSONPath regex, apply matches to strings only (dpp-criteria 4b17bb8) - #6
Merged
Conversation
…only (dpp-criteria 4b17bb8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapts dpplint to dpp-criteria 4b17bb8 (PR #6), sections "Regular expressions" and "Results" in CRITERIA-FORMAT.md.
Changes
match()andsearch()are checked before the JSONPath is evaluated. An invalid I-Regexp, or one with^or$outside a character class, makes the criterion skipped with the reason instead of letting the function return false.IRegexpnow reports these asInvalidorAnchored.^and$are no longer translated into anchors.^and$inside a character class stay allowed ([^a],[a^],[$]).matchesholds only for JSON strings. Numbers, booleans,null, arrays and objects never satisfy it and are no longer converted to text. Header values are always strings, so header assertions are unchanged.Tests
./build.sh(dpp-criteria 4b17bb8).^ab.*,.*bc$,^[Bb]atter,59040|PCDS$,(^a)anda\^bgive "contains … outside a character class";[^a],[a^],[$]and[\^]are accepted. An invalid I-Regexp gives the reason even withexists: false.applies_ifwithsearch(@, '^[Bb]atter')is skipped with the reason and does not enter "N of M".matches: matches the string "1", but not1,true,null, an array, an object or59040.0.Reference passport
https://dpp.oydapp.eu/01/09520123456788/21/000001:Results are from automated checks only and establish no presumption of conformity.
Decisions
\^outside a character class also counts as unusable, following the wording "must not contain^… outside a character class". This errs towards skipped, never failed.Open questions for dpp-criteria
\^outside a character class, or only an unescaped^?match()/search()(valid I-Regexp, no^/$outside a character class), so that an unusable pattern is caught in the pull request rather than by the runner?