question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve function docstrings

See original GitHub issue

Is your feature request related to a problem? Please describe.

Several docstrings in the codebase are either incomplete or non-existing. The following docstring for example, does not contain a description:

https://github.com/anuraghazra/github-readme-stats/blob/eacc3cd29cecde23d488023ff8dc2326bc69c25d/src/common/utils.js#L7-L28

and could therefore be improved to

/** Renders error message on the card.
 * @param {string} message
 * @param {string} secondaryMessage
 * @returns {string}
 */
const renderError = (message, secondaryMessage = "") => {
  return `
    <svg width="495" height="120" viewBox="0 0 495 120" fill="none" xmlns="http://www.w3.org/2000/svg">
    <style>
    .text { font: 600 16px 'Segoe UI', Ubuntu, Sans-Serif; fill: #2F80ED }
    .small { font: 600 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #252525 }
    .gray { fill: #858585 }
    </style>
    <rect x="0.5" y="0.5" width="494" height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/>
    <text x="25" y="45" class="text">Something went wrong! file an issue at https://tiny.one/readme-stats</text>
    <text data-testid="message" x="25" y="55" class="text small">
      <tspan x="25" dy="18">${encodeHTML(message)}</tspan>
      <tspan x="25" dy="18" class="gray">${secondaryMessage}</tspan>
    </text>
    </svg>
  `;
};

while others like

https://github.com/anuraghazra/github-readme-stats/blob/eacc3cd29cecde23d488023ff8dc2326bc69c25d/src/cards/stats-card.js#L15-L47

don’t contain a docstring at al

Describe the solution you’d like

I think it would increase the developer experience if these docstrings were updated/added.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rickstaacommented, Oct 7, 2022

@shivam1646 I added the last docstrings and merged #2129 into the master. Thanks for your contribution!

1reaction
rickstaacommented, Oct 4, 2022

@rym-oualha Thanks for wanting to contribute to this repository. I already assigned @shivam1646, so it is best to wait till he creates a new pull request or states which files he is tackling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use docstrings to improve your Python code
Using docstrings in Python makes it easier to see what functions do, what arguments they accept, and what they return. Here's how to...
Read more >
Start Writing Python Docstrings - Better Programming
Dear Python developer, start writing docstrings now! Proper documentation ensures that you're able to read and review your code weeks, even months later....
Read more >
Python Docstring: Documenting And Introspecting Functions
This tutorial explains what is Python Docstring and how to use it to document Python functions with examples.
Read more >
Python Docstrings (With Examples) - Programiz
Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. Let's take an example....
Read more >
How to Use Python Docstrings for Effective Code Documentation
Docstring Formats · Use triple double quotes to enclose docstrings. · Docstring ends with a dot. · It should describe the command of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found