Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions {{cookiecutter.project_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
rev: "1.20.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==25.*]
additional_dependencies: [black==26.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v6.0.0"
Expand Down Expand Up @@ -46,7 +46,7 @@ repos:
rev: "v0.15.4"
hooks:
- id: ruff-check
args: ["--fix", "--show-fixes"]
args: ["--fix"]
- id: ruff-format

{%- if cookiecutter.backend in ["pybind11", "skbuild", "mesonpy"] %}
Expand Down
4 changes: 1 addition & 3 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ disallow_incomplete_defs = true


[tool.ruff]
{%- if cookiecutter.backend == "poetry" %}
target-version = "py39"
{%- endif %}
show-fixes = true

[tool.ruff.lint]
extend-select = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Copyright (c) {{ cookiecutter.__year }} {{ cookiecutter.full_name }}. All rights reserved.
"""Copyright (c) {{ cookiecutter.__year }} {{ cookiecutter.full_name }}. All rights reserved.

{{ cookiecutter.project_name }}: {{ cookiecutter.project_short_description }}
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,31 @@ class Example:
def add(self, a: int, b: int) -> int:
"""Add two integers.

Notes:
Notes
-----
Docstring can be useful. I promise.

Parameters:
Parameters
----------
a: First integer to add.
b: Second integer to add.

Returns:
Returns
-------
The sum of the two integers.
"""
return a + b

def subtract(self, a: int, b: int) -> int:
"""Subtract two integers.

Parameters:
Parameters
----------
a: Integer to subtract from.
b: Integer to subtract.

Returns:
Returns
-------
The difference of the two integers.
"""
return a - b
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
import {{ cookiecutter.__project_slug }} as m


def test_version():
def test_version() -> None:
assert importlib.metadata.version("{{ cookiecutter.__project_slug }}") == m.__version__
Loading