From 3e59a69d36b00d263c2eeca1fd5810122dfae350 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 09:49:03 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`add-uti?= =?UTF-8?q?ls`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @GitRayk. * https://github.com/GitRayk/coderabbit-test/pull/1#issuecomment-2900593728 The following files were modified: * `simple_utils.py` --- simple_utils.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/simple_utils.py b/simple_utils.py index 3526e94..ae6cbd9 100644 --- a/simple_utils.py +++ b/simple_utils.py @@ -1,11 +1,37 @@ # simple_utils.py - A tiny utility library def reverse_string(text): - """Reverses the characters in a string.""" + """ + Reverses the characters in a string. + + Args: + text: The string to reverse. + + Returns: + A new string with the characters of text in reverse order. + """ return text[::-1] def count_words(sentence): + """ + Counts the number of words in a sentence. + + Args: + sentence: The input string to analyze. + + Returns: + The number of words separated by whitespace in the sentence. + """ return len(sentence.split()) def celsius_to_fahrenheit(celsius): + """ + Converts a temperature from Celsius to Fahrenheit. + + Args: + celsius: Temperature value in degrees Celsius. + + Returns: + The equivalent temperature in degrees Fahrenheit. + """ return (celsius * 9/5) + 32