From b2f9e80d3853e130fcb97c022a7783f63802d43c Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Mon, 3 Jun 2024 10:39:42 +0200 Subject: [PATCH] Make it build --- .pre-commit-config.yaml | 23 +++++++++-------------- .readthedocs.yaml | 17 +++++++++++++++++ form_designer/models.py | 4 +--- pyproject.toml | 10 +++++----- 4 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 .readthedocs.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7fa097..788a720 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/adamchainz/django-upgrade - rev: 1.15.0 + rev: 1.16.0 hooks: - id: django-upgrade args: [--target-version, "3.2"] @@ -23,7 +23,7 @@ repos: hooks: - id: absolufy-imports - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.13" + rev: "v0.3.2" hooks: - id: ruff - id: ruff-format @@ -33,21 +33,16 @@ repos: - id: prettier args: [--list-different, --no-semi] exclude: "^conf/|.*\\.html$" - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.54.0 - hooks: - - id: eslint - additional_dependencies: - - eslint - - eslint-config-prettier - - "@babel/core" - - "@babel/eslint-parser" - - "@babel/preset-env" + - repo: https://github.com/biomejs/pre-commit + rev: "v0.1.0" + hooks: + - id: biome-check + additional_dependencies: ["@biomejs/biome@1.7.3"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.6.0 + rev: 1.7.0 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.15 + rev: v0.16 hooks: - id: validate-pyproject diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..b2da4c0 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py +# python: +# install: +# - requirements: docs/requirements.txt +# - method: pip +# path: . diff --git a/form_designer/models.py b/form_designer/models.py index 2f394a2..454e23a 100644 --- a/form_designer/models.py +++ b/form_designer/models.py @@ -234,9 +234,7 @@ def old_name_loader(submission, old_name): if isinstance(field_type, dict): continue warnings.warn( - "Form designer field type {!r} still uses the old configuration format.".format( - field_type - ), + f"Form designer field type {field_type!r} still uses the old configuration format.", DeprecationWarning, stacklevel=1, ) diff --git a/pyproject.toml b/pyproject.toml index c8e5880..740ea2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ path = "form_designer/__init__.py" include = ["/form_designer"] [tool.ruff] -extend-select = [ +lint.extend-select = [ # pyflakes, pycodestyle "F", "E", "W", # mmcabe @@ -89,7 +89,7 @@ extend-select = [ # unused noqa "RUF100", ] -extend-ignore = [ +lint.extend-ignore = [ # Allow zip() without strict= "B905", # No line length errors @@ -99,14 +99,14 @@ fix = true show-fixes = true target-version = "py39" -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports = true lines-after-imports = 2 -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 15 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "*/migrat*/*" = [ # Allow using PascalCase model names in migrations "N806",