MarshalX / atproto

The AT Protocol (🦋 Bluesky) SDK for Python 🐍
https://atproto.blue
MIT License
282 stars 31 forks source link

Improve URL detection in auto_hyperlinks example #250

Closed 24rr closed 7 months ago

24rr commented 7 months ago

Fixes #141

MarshalX commented 7 months ago

Hi thank you! Could pls return blank empty line? Linter fails

24rr commented 7 months ago

Hi thank you! Could pls return blank empty line? Linter fails

Where do I return it?

MarshalX commented 7 months ago

Hi thank you! Could pls return blank empty line? Linter fails

Where do I return it?

Please check changes tab or GitHub actions logs. Line number 6. Between imports and function definition

24rr commented 7 months ago

Hi thank you! Could pls return blank empty line? Linter fails

Where do I return it?

Please check changes tab or GitHub actions logs. Line number 6. Between imports and function definition

Oh my bad. Done

MarshalX commented 7 months ago

@editor-syntax did i something wrong? just testing your regex with example from the issue

https://regex101.com/r/d3Hg78/1

image
24rr commented 7 months ago

@editor-syntax did i something wrong? just testing your regex with example from the issue

https://regex101.com/r/d3Hg78/1

image

Nope, but I did something wrong lol. It's updated now. image

MarshalX commented 7 months ago

now it doesnt work for links without (/) :(

image
24rr commented 7 months ago

now it doesnt work for links without (/) :(

image

Updated. That's my last resort lol! image image image

MarshalX commented 7 months ago

@editor-syntax it looks working. But you deleted the usage of "aggressive" bool. Now we have only 1 regex. But you didn't delete the argument of the function. If we are gonna delete "aggressive" mode we should remove all related things to it:

  1. argument in the function https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L8
  2. tune docstring of the function https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L10
  3. remove flag from here: https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L35
  4. remove this because now we will not have matches for links without protocol https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L40
24rr commented 7 months ago

@editor-syntax it looks working. But you deleted the usage of "aggressive" bool. Now we have only 1 regex. But you didn't delete the argument of the function. If we are gonna delete "aggressive" mode we should remove all related things to it:

  1. argument in the function https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L8
  2. tune docstring of the function https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L10
  3. remove flag from here: https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L35
  4. remove this because now we will not have matches for links without protocol https://github.com/MarshalX/atproto/blob/5505bd14d02ee1dcf72b473348d6ab49e3ba52ee/examples/advanced_usage/auto_hyperlinks.py#L40

Yes, we can do that. I'll edit the example code and you edit the rest

MarshalX commented 7 months ago

thank you!