Closed ineeee closed 1 year ago
outdated, see next comment
i've decided to enforce the docstring syntax to be ^([a-z0-9]+)( <[0-9a-z #@|]+>| \[[0-9a-z #@|]+\])*( -- |: )(.+)$
. this translates to command <required> [optional] -- description
.
outdated, see next comment
there are 99 commands that did not pass the test, out of 389 total
.bene
broke
progress:
<Taigabot> [TESTS] there are 71 commands that did not pass the test, out of 400 total
04:25:11 #testing.test_docstrings commands that failed the docstring test: - format: pushups defined in plugins/stupid.py:811 pushups/squats [nick] -- gives someone pushups/squats to do - format: squats defined in plugins/stupid.py:811 pushups/squats [nick] -- gives someone pushups/squats to do - format: madoka defined in plugins/stupid.py:822 madoka -- see how much Madoka_Miku has mired infinity... - format: weather defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: forecast defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: w defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: t defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: time defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: alerts defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: lyrics defined in plugins/lyrics.py:8 lyrics - Search genius.com for song lyrics - missing: test_function_definition defined in plugins/core_tests.py:43 - missing: export_plugins_json defined in plugins/core_tests.py:64 - missing: mask defined in plugins/core_admin_channel.py:15 - missing: match defined in plugins/core_admin_channel.py:47 - format: autoop defined in plugins/core_admin_channel.py:148 aop [channel] OR -- Add/Del Autoops. - multiline: disable defined in plugins/core_admin_channel.py:302 - multiline: enable defined in plugins/core_admin_channel.py:324 - multiline: disablehash defined in plugins/core_admin_channel.py:360 - multiline: enablehash defined in plugins/core_admin_channel.py:396 - multiline: flood defined in plugins/core_admin_channel.py:449 - multiline: cmdflood defined in plugins/core_admin_channel.py:477 - multiline: trim defined in plugins/core_admin_channel.py:567 - multiline: mute defined in plugins/core_admin_channel.py:612 - multiline: unmute defined in plugins/core_admin_channel.py:621 - multiline: lock defined in plugins/core_admin_channel.py:664 - multiline: unlock defined in plugins/core_admin_channel.py:673 - multiline: ban defined in plugins/core_admin_channel.py:716 - multiline: kb defined in plugins/core_admin_channel.py:716 - multiline: unban defined in plugins/core_admin_channel.py:759 - multiline: ub defined in plugins/core_admin_channel.py:759 - multiline: kick defined in plugins/core_admin_channel.py:784 - multiline: kal defined in plugins/core_admin_channel.py:784 - multiline: k defined in plugins/core_admin_channel.py:784 - multiline: op defined in plugins/core_admin_channel.py:806 - multiline: up defined in plugins/core_admin_channel.py:806 - multiline: deop defined in plugins/core_admin_channel.py:818 - multiline: down defined in plugins/core_admin_channel.py:818 - multiline: hop defined in plugins/core_admin_channel.py:833 - multiline: dehop defined in plugins/core_admin_channel.py:843 - multiline: voice defined in plugins/core_admin_channel.py:853 - multiline: devoice defined in plugins/core_admin_channel.py:862 - multiline: invite defined in plugins/core_admin_channel.py:872 - missing: testdamnit defined in plugins/core_admin_channel.py:929 - missing: wordoftheday defined in plugins/wordoftheday.py:8 - format: distance defined in plugins/distance.py:30 distance to -- Calculate the distance between 2 places. - missing: band defined in plugins/lastfm.py:5 - format: quote defined in plugins/quote.py:199 quote [add] <#chan | nick> [-r] [query | number] - format: q defined in plugins/quote.py:199 quote [add] <#chan | nick> [-r] [query | number] - format: rquote defined in plugins/quote.py:263 rquote - Deletes a quote from a nick - missing: mlb defined in plugins/major_league_baseball.py:36 - missing: users defined in plugins/masshighlight.py:58 - missing: getusers defined in plugins/masshighlight.py:64 - format: choose defined in plugins/choose.py:5 choose , [choice2], [choice3], ... -- Randomly picks one of the given choices. - format: decide defined in plugins/choose.py:5 choose , [choice2], [choice3], ... -- Randomly picks one of the given choices. - missing: ledzep defined in plugins/core_sieve.py:13 - missing: sudos defined in plugins/core_sieve.py:19 - format: gignored defined in plugins/core_admin_global.py:109 gignored [channel]-- Lists ignored channels/nicks/hosts. - format: doge defined in plugins/coins.py:106 who even cares about dogecoin in 2022 lmfao - missing: gptping defined in plugins/openai.py:96 - missing: gpt defined in plugins/openai.py:110 - missing: explain defined in plugins/openai.py:117 - missing: gptuwu defined in plugins/openai.py:123 - missing: gptunsafe defined in plugins/openai.py:132 - missing: gptveryunsafe defined in plugins/openai.py:141 - missing: gptveryveryunsafe defined in plugins/openai.py:150 - missing: dalle defined in plugins/openai.py:159 - missing: gpt4chan defined in plugins/openai.py:171 - missing: gptit defined in plugins/openai.py:179 - missing: gptgptgen defined in plugins/openai.py:187 - missing: gupta defined in plugins/openai.py:195 - missing: gptemoji defined in plugins/openai.py:203
5a8555b64b43ea01fbe42b7b7355f6f58480f9d4 lyrics.py
cec7ebe pushups
update: 31 failed / 405 total
commands that failed the docstring test: - missing: band defined in plugins/lastfm.py:5 - format: weather defined in plugins/weather.py:25 weather/time/alerts |[save] | <@ user> -- Gets weather data for . - format: forecast defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: w defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: t defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: time defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: alerts defined in plugins/weather.py:25 weather/time/alerts | [save] | <@ user> -- Gets weather data for . - format: quote defined in plugins/quote.py:199 quote [add] <#chan | nick> [-r] [query | number] - format: q defined in plugins/quote.py:199 quote [add] <#chan | nick> [-r] [query | number] - format: rquote defined in plugins/quote.py:263 rquote - Deletes a quote from a nick - format: doge defined in plugins/coins.py:106 who even cares about dogecoin in 2022 lmfao - format: distance defined in plugins/distance.py:30 distance to -- Calculate the distance between 2 places. - missing: ledzep defined in plugins/core_sieve.py:13 - missing: sudos defined in plugins/core_sieve.py:19 - format: gptit defined in plugins/openai.py:186 gptIT -- talk to chatgpt to try to solve your computer problems - missing: test_function_definition defined in plugins/core_tests.py:43 - missing: export_plugins_json defined in plugins/core_tests.py:64 - format: gignored defined in plugins/core_admin_global.py:109 gignored [channel]-- Lists ignored channels/nicks/hosts. - format: choose defined in plugins/choose.py:5 choose , [choice2], [choice3], ... -- Randomly picks one of the given choices. - format: decide defined in plugins/choose.py:5 choose , [choice2], [choice3], ... -- Randomly picks one of the given choices. - missing: mlb defined in plugins/major_league_baseball.py:36 - missing: users defined in plugins/masshighlight.py:58 - missing: getusers defined in plugins/masshighlight.py:64 - missing: mask defined in plugins/core_admin_channel.py:15 - missing: match defined in plugins/core_admin_channel.py:47 - format: autoop defined in plugins/core_admin_channel.py:148 aop [channel] OR -- Add/Del Autoops. - multiline: flood defined in plugins/core_admin_channel.py:445 - multiline: cmdflood defined in plugins/core_admin_channel.py:473 - multiline: trim defined in plugins/core_admin_channel.py:563 - multiline: mute defined in plugins/core_admin_channel.py:608 - missing: testdamnit defined in plugins/core_admin_channel.py:899
all 404 commands passed the test
♡ adrift
docstrings are used in decorated functions (i.e.
@hook.command
) to show help in the chat when people use the command incorrectly. there are a lot of missing docstrings currently, which makes commands silently fail (or sometimes throw an exception) when they don't get the expected input.i'm currently working with adrift to get docstrings to every single command.
the docstrings in taigabot should follow pep-0257: one-line docstrings using triple quotes as a string delimiter.
this code will check for missing docstrings:
https://github.com/inexist3nce/Taigabot/blob/146fa7b6b2fabc05f033593c72007c822e56b074/plugins/core_tests.py#L4-L11
edit
validated using: