Skip to content

Conversation

@yaphott
Copy link
Contributor

@yaphott yaphott commented Sep 16, 2023

Changes

  • Modified project and test requirements so that RE 2 is only required for testing.

  • Additional and improved examples in readme and throughout the code.

  • Fixes incorrect separator in the package name withing the Makefile.

  • Fixes incorrect return type and parameter names and types in the char_range and iter_char_range functions.

  • Added make_exp function to create a regex expression from an iterable of chars. For example:

    import regex_toolkit.base as rtk
    
    exp = "[" + rtk.make_exp(["a", "b", "c", "z", "y", "x"]) + "]"
    # Output: '[a-cx-z]'
  • Regex flavor keyword arguments will now default to a value of None instead of 1, however this does not change the original behavior or defaulting to RE 1.

    • This is due to adding a regex_toolkit.base.default_flavor value that can be monkey patched to change the default behavior. Like this:

      import regex_toolkit.base
      
      regex_toolkit.base.default_flavor = 2
  • Updated tests.

    • Added some missing test coverage including covering reserved expressions.
    • Moved many tests to Pytest.
  • "Cleaner" validation of regex flavor keyword arguments.

    • Added resolve_flavor function to resolve regex flavor keyword arguments.
  • Added a requirements-test.txt file to the root of the project for test requirements.

  • Updated README.md.

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (d667880) 82.47% compared to head (ac78922) 86.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
+ Coverage   82.47%   86.92%   +4.44%     
==========================================
  Files           5        5              
  Lines          97      130      +33     
  Branches       12       23      +11     
==========================================
+ Hits           80      113      +33     
+ Misses         16       14       -2     
- Partials        1        3       +2     
Flag Coverage Δ
unittests 86.92% <90.14%> (+4.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/regex_toolkit/__init__.py 100.00% <100.00%> (ø)
src/regex_toolkit/constants.py 100.00% <100.00%> (ø)
src/regex_toolkit/enums.py 100.00% <100.00%> (ø)
src/regex_toolkit/utils.py 76.47% <90.90%> (+8.82%) ⬆️
src/regex_toolkit/base.py 91.66% <88.09%> (+4.43%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…e` and add test for changing the default.
@yaphott yaphott merged commit 909b1c1 into main Oct 1, 2023
@yaphott yaphott deleted the 0.0.5-release branch October 1, 2023 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants