[APPROVED] FanCogs

Discord Name: tagape#3232

GitHub Repository (Must be V3): https://github.com/grayconcaves/FanCogs

Description: This repository contains a few fandom cogs I’ve made for my Red V3 bot, Super Dage .
This includes a customizable Ao3 details compiler, an MXTX fandom names to pinyin converter, a prompt and kink generator, and a random shiba pic cog.

Hi tagape, thank you for your patience while I review your repo. I have one issue that needs to be addressed and a lot of comments that are optional right now but should be considered for future growth.

Commit hash at time of review - d3a2208279163df749c06137e663753ee46a7c24

ao3

ao3.py

  • While there doesn’t appear to be anything majorly wrong with this cog it seems to be inconsistent in styling. Style is something we don’t look at for entry level cog creators but I feel like I need to mention it here. There’s tools to help you settle on the style you want but generally PEP8 suggests you stay consistent. I will list a few of the major examples that flake8 is telling me about:
    • Line 26-35: unexpected spaces around keyword/parameter equals. Keywords like this should have no space around the equals sign, the real issue is it’s inconsistent between different keywords, some have a space after the keyword and after the equals others have no space after the keyword but a space after the equals.
    • Line 43 and elsewhere: Comments in python follow the format # your comment here Note the space after the #
    • Line 55-56: indentation contains mixed spaces and tabs. Python has long debated the use of tabs vs spaces but the overarching rule regarding which to use is just be consistent. Don’t mix tabs and spaces if you prefer tabs use tabs for everything if you prefer spaces use spaces for everything. Most IDE’s will even let you reassign the tab key to put in a specified number of spaces to help you keep consistent as well.
    • Line 77 and elsewhere: You should not use bare excepts even having except Exception will let you catch everything going on while being more explicit. Ideally though you have some specific exception you want to catch and then you can more easily differentiate what is going wrong and potentially start logging errors when they happen. The blank except Exception tends to lead to silenced errors making it harder to determine why something isn’t working the way it should and one should consider alternative ways to find what they’re looking for.
    • Line 217 and 227: When you have a value that is a boolean argument the direct comparison of == is unnecessary as you can just do if not pred.result or if autodel alternatively if you want to keep it looking the way it is you can do if pred.result is False and if autodel is True

If you install black through the Red contributer guide and set it up you can run that and it will clean up a lot of these style inconsistenceis automatically for you.

mixtags

mxtxtags.py

  • Line 40: Regex patterns should be labelled as raw strings tl = re.split(r"(\W+)", tags.lower()) (Optional)

promptgenerator

promptgen.py

  • Given the NSFW nature of this cog all commands should be locked behind @commands.is_nsfw() ensuring the commands can only be used inside designated NSFW channels.

I should note that the comments under ao3.py apply to all your cogs, while they work as is and are fine, if you consider applying for Sr. Cog Creator at some point these items will need to be addressed and should be considered early to improve habits when writing new cogs.

Thank you so much for reviewing my repo, Trusty! I’ll fix these tonight.

I’ve updated my cogs based on your feedback, Trusty. I also made a few changes to promptgen to add an SFW command.

On another note, I did the style fixes manually since I couldn’t find the Red contributor guide you mentioned. I hope I found all the inconsistencies! I’ll note these for my future cogs.

Thank you!

Hi Tagape, I appologize for the delay in getting back to you. Thanks for making those changes, I am marking this as approved!