Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i/prompting: implement path pattern matching and validation #13866

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on May 25, 2024

  1. i/prompting: implement path pattern matching and validation

    Path pattern matching is implemented via the doublestar package, which
    emulates bash's globstar matching. Patterns may include '*' wildcard
    characters (which match any number of non-separator characters), '**'
    doublestars (which match zero or more subdirectories), '?' wildcard
    characters (which match exactly one non-separator character), and nested
    groups delimited by '{' and '}'. Notably, path patterns are *not* allowed
    to have character classes delimited by '[' and ']', nor inverted
    classes of the form "[^abc]".
    
    There is a limit on the number of groups allowed in path patterns, but
    up to that limit, groups may be arbitrarily nested or sequential.
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    
    i/prompting: fix typo and add notes to remove test boilerplate
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    
    i/prompting: use separate test suite for patterns
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    
    i/prompting: improve unit test coverage
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    olivercalder committed May 25, 2024
    Configuration menu
    Copy the full SHA
    0fce07d View commit details
    Browse the repository at this point in the history
  2. i/prompting: count and validate true number of expanded patterns

    Rather than counting the number of groups and using it as a heuristic
    for the number of patterns into which a given path pattern will expand,
    instead compute the true number of expanded patterns and compare it
    against a set limit.
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    olivercalder committed May 25, 2024
    Configuration menu
    Copy the full SHA
    aceec3c View commit details
    Browse the repository at this point in the history
  3. i/prompting: implement path pattern checks in constraints

    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    olivercalder committed May 25, 2024
    Configuration menu
    Copy the full SHA
    eff5c6d View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. i/prompting: throw error if group depth exceeds maximum expanded patt…

    …erns
    
    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    olivercalder committed May 29, 2024
    Configuration menu
    Copy the full SHA
    2961843 View commit details
    Browse the repository at this point in the history
  2. packaging: add doublestar dependency for prompting pattern matching

    Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
    olivercalder committed May 29, 2024
    Configuration menu
    Copy the full SHA
    deff68c View commit details
    Browse the repository at this point in the history