Skip to content

ref: normalize slash matching regexes #93746

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

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

asottile-sentry
Copy link
Member

@asottile-sentry asottile-sentry commented Jun 17, 2025

in python escaping forward slash is not necessary so \/ does nothing -- normalize to not doing the unnecessary thing

automated w/

git grep -E -l '\[\^\\\\?/\]' -- '*.py' | xargs sed -i -r 's|\[\^\\\\?/\]|[^/]|g'

I'm doing this to better audit our urls for cellularization

@asottile-sentry asottile-sentry requested a review from a team June 17, 2025 19:59
@asottile-sentry asottile-sentry requested review from a team as code owners June 17, 2025 19:59
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 17, 2025
in python escaping forward slash is not necessary so \/ does nothing -- normalize to not doing the unnecessary thing

automated w/

```bash
git grep -E -l '\[\^\\\\?/\]' -- '*.py' | xargs sed -i -r 's|\[\^\\\\?/\]|[^/]|g'
```
Copy link
Member

@joshuarli joshuarli left a comment

Choose a reason for hiding this comment

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

sweet

Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tests/sentry/conf/test_urls.py 92.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #93746   +/-   ##
=======================================
  Coverage   88.02%   88.02%           
=======================================
  Files       10330    10331    +1     
  Lines      596117   596142   +25     
  Branches    23153    23153           
=======================================
+ Hits       524754   524780   +26     
+ Misses      70912    70911    -1     
  Partials      451      451           

@asottile-sentry asottile-sentry merged commit 8141497 into master Jun 18, 2025
64 checks passed
@asottile-sentry asottile-sentry deleted the asottile-no-need-to-escape-slash branch June 18, 2025 13:01
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
in python escaping forward slash is not necessary so \\/ does nothing --
normalize to not doing the unnecessary thing

automated w/

```bash
git grep -E -l '\[\^\\\\?/\]' -- '*.py' | xargs sed -i -r 's|\[\^\\\\?/\]|[^/]|g'
```

I'm doing this to better audit our urls for cellularization

<!-- Describe your PR here. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants