diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml index 193c7145..af8a46b8 100644 --- a/{{cookiecutter.project_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_name}}/.pre-commit-config.yaml @@ -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" @@ -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"] %} diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 7ff65f07..171031ab 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -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 = [ diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py index d7c11f49..83b63f89 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py @@ -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 }} """ diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/example.py b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/example.py index 99f366b4..a44ca1ea 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/example.py +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/example.py @@ -7,14 +7,17 @@ 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 @@ -22,11 +25,13 @@ def add(self, a: int, b: int) -> int: 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 diff --git a/{{cookiecutter.project_name}}/tests/test_package.py b/{{cookiecutter.project_name}}/tests/test_package.py index 4d7300d7..592b1e43 100644 --- a/{{cookiecutter.project_name}}/tests/test_package.py +++ b/{{cookiecutter.project_name}}/tests/test_package.py @@ -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__