I added a pull request (see https://github.com/django/django/pull/8414)
which fixes this problems, it also is faster and handles many more regex
patterns. I also extended the `test_simplify_regex` test.
--
Ticket URL: <https://code.djangoproject.com/ticket/28135>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Cleanup/optimization
* has_patch: 0 => 1
* component: Uncategorized => contrib.admindocs
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:1>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the PR. Please uncheck "Patch needs
improvement" after updating.
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:2>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:3>
Comment (by Rohith P R):
https://github.com/django/django/pull/14070 : Refs #28135 -- Added
replace_metacharacters to simplify regexes
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:4>
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:6>
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:5>
* owner: nobody => Felix Zhang
* status: new => assigned
Old description:
> While using Django REST Framework's Schema generator, I found out they're
> using `simplify_regex()`; however, current version has a few
> shortcomings, namely non-capturing groups are broken.
>
> I added a pull request (see https://github.com/django/django/pull/8414)
> which fixes this problems, it also is faster and handles many more regex
> patterns. I also extended the `test_simplify_regex` test.
New description:
While using Django REST Framework's Schema generator, I found out they're
using `simplify_regex()`; however, current version has a few shortcomings,
namely non-capturing groups are broken.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:6>
* has_patch: 0 => 1
Old description:
> While using Django REST Framework's Schema generator, I found out they're
> using `simplify_regex()`; however, current version has a few
> shortcomings, namely non-capturing groups are broken.
New description:
While using Django REST Framework's Schema generator, I found out they're
using `simplify_regex()`; however, current version has a few shortcomings,
namely non-capturing groups are broken.
I have opened a [https://github.com/django/django/pull/14756 pull request]
that allows `simplify_regex()` to handle non-capturing groups and
additional tests for them in `test_simplify_regex()`.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:7>
Old description:
> While using Django REST Framework's Schema generator, I found out they're
> using `simplify_regex()`; however, current version has a few
> shortcomings, namely non-capturing groups are broken.
>
> I have opened a [https://github.com/django/django/pull/14756 pull
> request] that allows `simplify_regex()` to handle non-capturing groups
> and additional tests for them in `test_simplify_regex()`.
New description:
While using Django REST Framework's Schema generator, I found out they're
using `simplify_regex()`; however, current version has a few shortcomings,
namely non-capturing groups are broken.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:8>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:9>
* owner: Felix Zhang => Ayush Joshi
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:10>
Comment (by Ayush Joshi):
I've created a patch for this issue I'm about to make a PR :).
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:11>
* needs_better_patch: 1 => 0
Comment:
You need to uncheck "Patch needs improvement" so the ticket appears in the
review queue. Please don't use mass @ mentions on the PR to request a
review.
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:12>
Comment (by Ayush Joshi):
Replying to [comment:12 Tim Graham]:
> You need to uncheck "Patch needs improvement" so the ticket appears in
the review queue. Please don't use mass @ mentions on the PR to request a
review.
Sorry, Felisiak never came so I have to ask someone else lol
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:13>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:14>
* needs_better_patch: 1 => 0
Comment:
Replying to [comment:14 Mariusz Felisiak]:
Okay I updated that PR to only include feature, I'll create new PR for
code refactor :thumbsup:.
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:15>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"827bc0704761f2c985539d98165420d4fcc0d682" 827bc070]:
{{{
#!CommitTicketReference repository=""
revision="827bc0704761f2c985539d98165420d4fcc0d682"
Refs #28135 -- Refactored out _find_groups()/_get_group_start_end() hooks
in admindocs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:16>
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:17>
Comment (by Ayush Joshi):
https://github.com/django/django/pull/15316
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:18>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:19>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:20>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0a17666045de6739ae1c2ac695041823d5f827f7" 0a17666]:
{{{
#!CommitTicketReference repository=""
revision="0a17666045de6739ae1c2ac695041823d5f827f7"
Fixed #28135 -- Made simplify_regex() handle non-capturing groups.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28135#comment:21>