adafruit / adabot

Adabot is our robot friend who helps Adafruit online
MIT License
13 stars 27 forks source link

strip lib string before parse #376

Closed FoamyGuy closed 3 weeks ago

FoamyGuy commented 3 weeks ago

For some reason some of the lib strings have a \r at the end of them i.e.

"[ticks](https://github.com/adafruit/Adafruit_CircuitPython_Ticks/releases/1.1.0)\r"

That causes parse.parse() to return None instead of the matched variables. Which then raises an exception 2 lines later when an attempt to access comps["link_comp"].

This resolves it by calling .strip() prior to parse() so that the string value will match the pattern that parse is expecting.

I tested it successfully by running python3 -m adabot.circuitpython_libraries with the appropriate env variables set up.