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

Rewrite substitution parser #2861

Merged
merged 12 commits into from
Jan 16, 2023

Commits on Jan 15, 2023

  1. Double backslash should escape to backslash

    The resulting escaped value should not then be
    subsequently used as an escape in future replacement
    rounds.
    
    Additional friends, like triple backslash, which
    should escape the following, and quad backslash,
    which should escape to two single backslashes
    and not escape the following characters.
    
    The Quad backslash test case also has escaped
    double backslash at the beginning and end of the
    string for more edge coverage.
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    400f4c4 View commit details
    Browse the repository at this point in the history
  2. test_replace_os_sep_before_curly

    explicit test case for issue tox-dev#2732 which affects
    {/} os.sep replacement on windows platform.
    
    test_replace_os_sep_subexp_regression
    
    WiP
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    44996c0 View commit details
    Browse the repository at this point in the history
  3. test_replace_env_when_value_is_backslash: replacement yields \

    When the replacement value is a backslash, it shouldn't escape the next
    part of the value.
    
    However, if the replacement contains a backslash, then it could affect
    the next value.
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    9325d66 View commit details
    Browse the repository at this point in the history
  4. test_replace_env_var_circular_flip_flop

    go back and forth between mututally circular env vars
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    87986ed View commit details
    Browse the repository at this point in the history
  5. test_replace_env_default_deep

    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    20a6e6c View commit details
    Browse the repository at this point in the history
  6. test_replace_env_var_chase: indirect refs

    When the env var name is itself given by another env var
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    6b66f77 View commit details
    Browse the repository at this point in the history
  7. iterative and recursive parsing of replacement expression

    walk through the expression character by character, recursively
    descending on left curly brace and breaking arguments along the way
    should allow for arbitrarily complex nested expressions that do NOT
    affect adjacent expressions.
    
    enabling recursive replacement could be allowed on a per-expression
    basis, but that is not currently done
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    32dcacb View commit details
    Browse the repository at this point in the history
  8. test_replace: fixup expectations and additional high level cases

    test_replace: {toxinidir,}
    	shouldn't be replaced with the trailing comma
    
    test_replace: add test case for escaped colon arg sep
    
    test_replace: additional cases for test_match
    
    	Single capital letter variable
    	Single backslash
    	Backslash escape non-special character
    	Windows path shouldn't be mangled
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    36e7380 View commit details
    Browse the repository at this point in the history
  9. docs/config.rst: add substitutions sections

    describe ini-style curly brace substitutions
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    9329377 View commit details
    Browse the repository at this point in the history
  10. cr: changelog - fix issue number and mark as feature

    this is a change in behavior, not merely a bugfix
    
    changelog: mention API names added and removed from the replace module
    to help people who might be searching for these names from error messages, etc
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    64b961e View commit details
    Browse the repository at this point in the history
  11. replace: MatchExpression clean up position tracking

    a first step at tracking enough position information to recreate the
    find_replace_part API; this one also improves the typing and readability of the
    class, so that the functions don't have to pass the term_pos in a tuple return
    value.
    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    3f66e3a View commit details
    Browse the repository at this point in the history
  12. cr: MatchError: docstring

    masenf committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    2231986 View commit details
    Browse the repository at this point in the history