-
-
Notifications
You must be signed in to change notification settings - Fork 715
PEP command incorrectly assumes file extension type #367
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
Comments
so instead of assuming one or the other, could we just check for both? |
I think that's a good idea. We could still implement a look-up order with the current division (or a better one) to minimize the number of API calls we make. I'm not sure how relevant that is and how often this feature is used, though. |
Unfortunately, I think the simplest solution would be to write a script to generate a mapping of pep number to file extension, then hardcode that lookup table in the bot. |
simplest solution is to hardcode a lookup table? but new peps get added all the time. that sounds like by far the most complicated solution, the simplest would be to just make two requests. our bot could technically even make them in parallel since it's async, thus taking roughly the same time as it does now. |
I suppose making extra requests doesn't hurt, it just unnecessary work for every issue of the command. However, the reduction in maintenance overhead is probably worth it. |
looks like the command have been used less than 100 times by our users. there are mostly staff that uses it, and that is not even remotely high. We are talking among the magnitude of less than once per day. also, 90% is !pep 8, so maybe make a "normal" tag out of it? one that is more descriptive of what it means and is. |
edit: Nevermind, we do want to be sensitive to status changes of the pep, which would mean we could only cache the correct URL to make a request to. This optimization, from 2 to 1 requests is not really worth refactoring the code. I think a normal tag for |
making extra requests at this scale, that is maybe 100 times over what, 8, 9 months? is completely acceptable. |
if we could make both requests in parallel that would be nice though, so as not to double execution time. |
The current implementation of the PEP command assumes that PEPs before PEP 542 are written in
.txt
, and PEPs after PEP 542 are written in.rst
.bot/bot/cogs/utils.py
Lines 40 to 43 in 301e877
That is not the case.
PEPs before 542 that are written in
.rst
:pep-0012
,pep-0013
,pep-0505
Peps after 542 that are written in
.txt
:pep-0544
,pep-0545
,pep-0546
,pep-0628
.pep-0666
,pep-0754
pep-3xxx
There was a PR in 2017 that renamed every
.txt
PEP file to.rst
that got merged, but was later reverted because revision history was lost doing so. Therefore it is very likely these edge cases will remain.The text was updated successfully, but these errors were encountered: