diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index c8fa9ce2..8a019ccf 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -70,8 +70,10 @@ exclude = [ ".eggs", ".tox", ".ipynb_checkpoints", + "noxfile.py", + "docs/conf.py", ] -ignore = ["A003", "B008", "E501"] +ignore = ["A003", "B008", "E501", "D211", "D213", "D417"] # Aggressively activate all rules. # These may be customized as desired: https://beta.ruff.rs/docs/rules/ @@ -85,7 +87,7 @@ classmethod-decorators = ["classmethod", "validator", "root_validator"] [tool.ruff.per-file-ignores] "*/__init__.py" = ["F401"] -"*/tests/*" = [ +"**/tests/*" = [ # asserts are encouraged in pytest "S101", # return annotations don't add value for test functions diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/functions.py b/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/functions.py index 83ff6c5d..78097a38 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/functions.py +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/functions.py @@ -7,21 +7,24 @@ def example_function(number1: int, number2: int) -> str: - """Example function comparing two integers. + """Compare two integers. - This function can be deleted. It is used to show and test generating + This is merely an example function can be deleted. It is used to show and test generating documentation from code, type hinting, testing, and testing examples in the code. Args: + ---- number1: The first number. number2: The second number, which will be compared to number1. Returns: + ------- A string describing which number is the greatest. Examples: + -------- Examples should be written in doctest format, and should illustrate how to use the function. @@ -31,5 +34,5 @@ def example_function(number1: int, number2: int) -> str: """ if number1 < number2: return f"{number1} is less than {number2}" - else: - return f"{number1} is greater than or equal to {number2}" + + return f"{number1} is greater than or equal to {number2}"