Skip to content
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

docs: add missing docstrings to async_utils.py #3385

Closed
terriko opened this issue Oct 4, 2023 · 7 comments
Closed

docs: add missing docstrings to async_utils.py #3385

terriko opened this issue Oct 4, 2023 · 7 comments
Assignees
Labels
documentation Documentation changes good first issue Good for newcomers hacktoberfest good issue for hacktoberfest participation

Comments

@terriko
Copy link
Contributor

terriko commented Oct 4, 2023

We haven't been entirely consistent about adding python docstrings to every function, and I'd like to start improving the codebase. I'm filing separate tickets for each file I want updated so hacktoberfest folk can claim them more easily -- please only claim one or two at a time.

Here's a tutorial on docstrings in case you're not sure what they are. Basically I want someone to write a short sentence explaining what a function does and have it put at the top of the function in the way that python expects docstrings to look. (You can also do classes and methods.)

This issue is for updating the file fetch_json_db.py. interrogate (a tool for checking docstrings) says it's missing the following docstrings:

------------------------------ Detailed Coverage -------------------------------

Name Status
async_utils.py
async_wrap (L46) MISSED
async_wrap.run (L48) MISSED
get_event_loop (L57) MISSED
run_coroutine (L70) MISSED
aio_run_command (L77) MISSED
ChangeDirContext (L91) MISSED
ChangeDirContext.aenter (L96) MISSED
ChangeDirContext.aexit (L99) MISSED
FileIO (L103) MISSED
FileIO.call (L126) COVERED
FileIO.open (L133) MISSED
FileIO._setup (L139) MISSED
FileIO.aenter (L191) MISSED
FileIO.aexit (L194) MISSED
FileIO.anext (L197) MISSED
FileIO.aiter (L204) MISSED
TemporaryFile (L208) MISSED
TemporaryFile._setup (L214) MISSED
NamedTemporaryFile (L219) MISSED
SpooledTemporaryFile (L223) MISSED
GzipFile (L228) MISSED
RateLimiter (L232) COVERED
RateLimiter.get (L250) MISSED
RateLimiter.wait_for_token (L254) MISSED
RateLimiter.add_new_tokens (L260) MISSED
RateLimiter.close (L268) MISSED
------------------------------------------------------------------- ----------

You will need to actually read the file and figure out what it does, then describe each function. Feel free to ask questions if you're not sure, or submit a partial fix where you only add docstrings to some functions.

Short tips for new contributors:

  • cve-bin-tool's contributor docs
  • If you've contributed to open source but not this project, you might just want our checklist for a great pull request
  • cve-bin-tool uses https://www.conventionalcommits.org/ style for commit messages, and we have a test that checks the title of your pull request (PR). A good potential title for this one is in the title of this issue.
  • You can make an issue auto close by including a comment "fixes #ISSUENUMBER" in your PR comments where ISSUENUMBER is the actual number of the issue. This "links" the issue to the pull request.

Claiming issues:

  • You do not need to have an issue assigned to you before you work on it. To "claim" an issue either make a linked pull request or comment on the issue saying you'll be working on it.
  • If someone else has already commented or opened a pull request, assume it is claimed and find another issue to work on.
  • If it's been more than 1 week without progress, you can ask in a comment if the claimant is still working on it before claiming it yourself (give them at least 3 days to respond before assuming they have moved on).
@terriko terriko added good first issue Good for newcomers documentation Documentation changes hacktoberfest good issue for hacktoberfest participation labels Oct 4, 2023
@pranshu-raj-211
Copy link
Contributor

Hi could I work on this issue?

@terriko
Copy link
Contributor Author

terriko commented Oct 4, 2023

@Kaito117 I've assigned it to you! Let us know if you get stuck. This particular file is missing more docstrings than most!

@SuryaCreatX
Copy link

Please assign me this issue?

@pranshu-raj-211
Copy link
Contributor

@SuryaCreatX I'm still working on the issue.

@NabhiA
Copy link
Contributor

NabhiA commented Oct 19, 2023

@Kaito117 Hello ! Are you still working on the issue ?

@pranshu-raj-211
Copy link
Contributor

pranshu-raj-211 commented Oct 20, 2023

@NabhiA
Yes!
My internet connection was cut off for more than a week, so I was not able to look up some parts I'm having issues with. I'll submit a PR within a day.

terriko pushed a commit that referenced this issue Oct 23, 2023
@terriko
Copy link
Contributor Author

terriko commented Oct 23, 2023

Closed with #3442

@terriko terriko closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation changes good first issue Good for newcomers hacktoberfest good issue for hacktoberfest participation
Projects
None yet
Development

No branches or pull requests

4 participants