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

remove URL regex caret anchor #280

Merged
merged 2 commits into from
Dec 10, 2024
Merged

remove URL regex caret anchor #280

merged 2 commits into from
Dec 10, 2024

Conversation

missinglink
Copy link
Member

This PR adjusts the URL detection regex by removing the leading ^ caret anchor.
This allows us to detect URLs within strings containing other characters.

Found via: #279 (comment)

Originally added in: d4c5305

@missinglink
Copy link
Member Author

I've added a second commit which reworks the URL detection, so instead of discarding names containing URLs, we now strip the URL component and then try to recover the rest of the name.

Copy link
Member

@orangejulius orangejulius left a comment

Choose a reason for hiding this comment

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

Yeah good idea. Might as well use what information is there

@orangejulius
Copy link
Member

We should probably port this to the OSM importer too, we get so many questions about these errors.

@missinglink missinglink merged commit ce57c15 into master Dec 10, 2024
6 checks passed
@missinglink missinglink deleted the detect-url-in-name branch December 10, 2024 08:44
@Joxit
Copy link
Member

Joxit commented Dec 11, 2024

Why don't you use this logic in model repository? Instead of throw an error try to trim the http / ftp and if the name is empty throw the error with the original name? 🤔

@missinglink
Copy link
Member Author

Why don't you use this logic in model repository?

Hmm yeah, good idea, I was originally thinking that model would only validate things and the individual importers would be better suited to cleaning their data, but you're right, it would make it much easier to maintain and avoid all these GH issues with people complaining about the warnings.

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.

3 participants