From 17db201d2d502cd73046f513631aa7430a3c292c Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 8 Jan 2025 02:28:48 +0100 Subject: [PATCH 1/2] enable preview mode for ruff --- {{ cookiecutter.__dirname }}/ruff.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.__dirname }}/ruff.toml b/{{ cookiecutter.__dirname }}/ruff.toml index db37c83..970c292 100644 --- a/{{ cookiecutter.__dirname }}/ruff.toml +++ b/{{ cookiecutter.__dirname }}/ruff.toml @@ -6,6 +6,7 @@ target-version = "py38" line-length = 100 [lint] +preview = true select = ["I", "PL", "UP"] extend-select = [ From 9c0bde68b9e8b7c46a558248ce3b6cd133d022a6 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 12 Jan 2025 22:29:32 +0100 Subject: [PATCH 2/2] fix conf.py for ruff --- ...phinx_docs in ['y', 'yes'] %}conf.py{% endif %} | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/{{ cookiecutter.__dirname }}/docs/{% if cookiecutter.sphinx_docs in ['y', 'yes'] %}conf.py{% endif %} b/{{ cookiecutter.__dirname }}/docs/{% if cookiecutter.sphinx_docs in ['y', 'yes'] %}conf.py{% endif %} index fbc00ea..cadb1e9 100644 --- a/{{ cookiecutter.__dirname }}/docs/{% if cookiecutter.sphinx_docs in ['y', 'yes'] %}conf.py{% endif %} +++ b/{{ cookiecutter.__dirname }}/docs/{% if cookiecutter.sphinx_docs in ['y', 'yes'] %}conf.py{% endif %} @@ -1,12 +1,10 @@ -# -*- coding: utf-8 -*- - # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries # # SPDX-License-Identifier: MIT +import datetime import os import sys -import datetime sys.path.insert(0, os.path.abspath("..")) @@ -34,10 +32,10 @@ autodoc_preserve_defaults = True intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - {%- if cookiecutter.requires_bus_device in ["y", "yes"] -%} + {% if cookiecutter.requires_bus_device in ["y", "yes"] -%} "BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None), - {% endif %} - {%- if cookiecutter.requires_register in ["y", "yes"] -%} + {%- endif %} + {% if cookiecutter.requires_register in ["y", "yes"] -%} "Register": ("https://docs.circuitpython.org/projects/register/en/latest/", None), {%- endif %} "CircuitPython": ("https://docs.circuitpython.org/en/latest/", None), @@ -59,9 +57,7 @@ project = "{% if cookiecutter.target_bundle != 'CircuitPython Org' %}{% if cooki creation_year = "{% now 'utc', '%Y' %}" current_year = str(datetime.datetime.now().year) year_duration = ( - current_year - if current_year == creation_year - else creation_year + " - " + current_year + current_year if current_year == creation_year else creation_year + " - " + current_year ) copyright = year_duration + " {{ cookiecutter.author_name }}" author = "{{ cookiecutter.author_name }}"