Skip to content

Commit

Permalink
Update so that pre-commit passes OOTB
Browse files Browse the repository at this point in the history
  • Loading branch information
mmwinther committed Sep 7, 2023
1 parent a61fad0 commit 593c8f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}"

0 comments on commit 593c8f7

Please sign in to comment.