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

Fix #86 -- Add support for an optional regex dependency #85

Merged
merged 18 commits into from
Aug 9, 2024

Conversation

yangcht
Copy link
Contributor

@yangcht yangcht commented Aug 1, 2024

Adding a regex example to find line-length issues of any non-comment part of the code.

Adding a regex example to find line-length issues of any non-comment part of the code.
upgrade from re to regex to support more features.
upgrade to regex from re
Fixing unicode issues
@yangcht yangcht changed the title Update COOKBOOK.md switch to regex for more features & COOKBOOK.md & Aug 2, 2024
@codingjoe
Copy link
Owner

Hi @yangcht,

Thank you for contributing to relint. I always love to see how people use this package.

Would you be so kind and split the cookbook suggestions and the new dependency into two pull-requests? Furthermore, I'd love to keep regex as an optional dependency. So maybe wrap it in a try block and add it to the package extras.

Since we don't actually ship any linting rules, having a separate dependency is not needed in all cases.

Please reach out to me if you require any assistance with that.

Best!
Joe

@yangcht
Copy link
Contributor Author

yangcht commented Aug 7, 2024

Hi @codingjoe ,

Thanks for the nice suggestions! I have splitter the PR. I issued another PR for the cookbook change and made this PR only about the usage of the regex package.

@yangcht yangcht changed the title switch to regex for more features & COOKBOOK.md & Adding regex package to handle more complicated regex patterns Aug 7, 2024
@yangcht
Copy link
Contributor Author

yangcht commented Aug 7, 2024

Hi @codingjoe, I have made the changs for the code plus some tests. Please have a look. Thanks!

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f3049f7) to head (0b56dd6).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #85   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          149       153    +4     
=========================================
+ Hits           149       153    +4     

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

relint/parse.py Fixed Show fixed Hide fixed
Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yangcht,

Thank you for your contribution. I had this lightly different in mind. Installing dependencies without a user's knowledge is dangerous. Besides, pip doesn't need to be installed on the system, so the command would fail.

Anyhow, I took the liberty to amend a couple of commits and to update the CI suite to test with regex installed.

Please let me know if this works for you, and I will merge and release this patch.

Best,
Joe

@yangcht
Copy link
Contributor Author

yangcht commented Aug 9, 2024

Hi @codingjoe,

Thanks for the commits. I agree with your points. I just tested the new version, and it works well.
Please go ahead with the merge and release (the cookbook update is also in another PR).

Cheers,
Chentao

@codingjoe codingjoe changed the title Adding regex package to handle more complicated regex patterns Add support for an optional regex dependency Aug 9, 2024
@codingjoe codingjoe changed the title Add support for an optional regex dependency Fix #86 -- Add support for an optional regex dependency Aug 9, 2024
@codingjoe codingjoe merged commit 4eef740 into codingjoe:main Aug 9, 2024
12 checks passed
@yangcht yangcht deleted the patch-1 branch August 9, 2024 16:53
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