route method regex explained#2
Open
Lucas-lufa wants to merge 2 commits into
Open
Conversation
Reviewer's Guide by SourceryThis pull request adds comments to explain the regex pattern used in the route method. The changes focus on providing a detailed explanation of each component of the regex, improving code readability and understanding. File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @Lucas-lufa - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider consolidating the regex comments into a single, more comprehensive explanation of the regex's purpose in the routing mechanism, rather than explaining individual syntax elements.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟡 Documentation: 1 issue found
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Comment on lines
+426
to
+431
| // /is the start and end of regex pattern | ||
| // \escapes the curly brace, making it a regular character, it's looking for it. | ||
| // parenthesis is the capturing group | ||
| // . is any character that is not a newline | ||
| // + is one or more proceeding elements | ||
| // ? lazy making match as few characters as possible |
There was a problem hiding this comment.
suggestion (documentation): Consider condensing the regex explanation comments
While the detailed explanation is helpful, it might be more concise to combine some of these comments. For example: '// / marks regex start/end, \ escapes {, (.+?) captures any chars (non-greedy)'
Suggested change
| // /is the start and end of regex pattern | |
| // \escapes the curly brace, making it a regular character, it's looking for it. | |
| // parenthesis is the capturing group | |
| // . is any character that is not a newline | |
| // + is one or more proceeding elements | |
| // ? lazy making match as few characters as possible | |
| // / marks regex start/end, \ escapes {, (.+?) captures any chars (non-greedy) | |
| // () is capturing group, . any char except newline, + one or more, ? lazy match |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Put in comments to explain what the regex in the route method is doing
Summary by Sourcery
Add explanatory comments to the regex pattern in the route method to clarify its functionality.
Documentation: