From 3f6de9019185d7939ae0cf35f6f08f88ef653cb8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:34:06 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.5...v0.5.0) - [github.com/psf/black-pre-commit-mirror: 24.3.0 → 24.4.2](https://github.com/psf/black-pre-commit-mirror/compare/24.3.0...24.4.2) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.1) - [github.com/tox-dev/pyproject-fmt: 1.7.0 → 2.1.3](https://github.com/tox-dev/pyproject-fmt/compare/1.7.0...2.1.3) - [github.com/abravalheri/validate-pyproject: v0.16 → v0.18](https://github.com/abravalheri/validate-pyproject/compare/v0.16...v0.18) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d788d2c..f047493 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.5.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-case-conflict - id: check-merge-conflict @@ -23,7 +23,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.1 hooks: - id: mypy args: [--strict, --pretty, --show-error-codes, .] @@ -32,13 +32,13 @@ repos: pass_filenames: false - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.7.0 + rev: 2.1.3 hooks: - id: pyproject-fmt additional_dependencies: [tox] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.18 hooks: - id: validate-pyproject From 062219db88d9398bcf8f8888ebd055463a2e7d66 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:17:31 +0300 Subject: [PATCH 2/3] Configure pyproject-fmt for 3.13 Trove classifier --- .pre-commit-config.yaml | 16 +++++++++-- pyproject.toml | 63 +++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f047493..a8f887b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: v0.5.0 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.4.2 @@ -13,6 +13,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: + - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - id: check-json @@ -20,8 +21,20 @@ repos: - id: check-yaml - id: debug-statements - id: end-of-file-fixer + - id: forbid-submodules - id: trailing-whitespace + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.6 + hooks: + - id: check-github-workflows + - id: check-renovate + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.1 + hooks: + - id: actionlint + - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.10.1 hooks: @@ -35,7 +48,6 @@ repos: rev: 2.1.3 hooks: - id: pyproject-fmt - additional_dependencies: [tox] - repo: https://github.com/abravalheri/validate-pyproject rev: v0.18 diff --git a/pyproject.toml b/pyproject.toml index 472f28e..c1c8dff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,10 @@ keywords = [ "restructuredtext", "rst", ] -license = {text = "MIT"} -authors = [{name = "Hugo van Kemenade"}] +license = { text = "MIT" } +authors = [ + { name = "Hugo van Kemenade" }, +] requires-python = ">=3.10" classifiers = [ "Development Status :: 3 - Alpha", @@ -40,18 +42,15 @@ dependencies = [ 'pyperclip; platform_system == "Darwin"', 'pyperclip; platform_system == "Windows"', ] -[project.optional-dependencies] -tests = [ +optional-dependencies.tests = [ "pytest", "pytest-cov", ] -[project.urls] -Changelog = "https://github.com/hugovk/linkotron/releases" -Homepage = "https://github.com/hugovk/linkotron" -Source = "https://github.com/hugovk/linkotron" -[project.scripts] -linkotron = "linkotron.cli:main" -linky = "linkotron.cli:main" +urls.Changelog = "https://github.com/hugovk/linkotron/releases" +urls.Homepage = "https://github.com/hugovk/linkotron" +urls.Source = "https://github.com/hugovk/linkotron" +scripts.linkotron = "linkotron.cli:main" +scripts.linky = "linkotron.cli:main" [tool.hatch] version.source = "vcs" @@ -59,31 +58,39 @@ version.source = "vcs" [tool.hatch.version.raw-options] local_scheme = "no-local-version" -[tool.ruff.lint] -select = [ - "C4", # flake8-comprehensions - "E", # pycodestyle errors - "EM", # flake8-errmsg - "F", # pyflakes errors - "I", # isort - "ISC", # flake8-implicit-str-concat - "LOG", # flake8-logging - "PGH", # pygrep-hooks +[tool.ruff] +fix = true + +lint.select = [ + "C4", # flake8-comprehensions + "E", # pycodestyle errors + "EM", # flake8-errmsg + "F", # pyflakes errors + "I", # isort + "ISC", # flake8-implicit-str-concat + "LOG", # flake8-logging + "PGH", # pygrep-hooks + "RUF022", # unsorted-dunder-all "RUF100", # unused noqa (yesqa) - "UP", # pyupgrade - "W", # pycodestyle warnings - "YTT", # flake8-2020 + "UP", # pyupgrade + "W", # pycodestyle warnings + "YTT", # flake8-2020 ] -extend-ignore = [ +lint.ignore = [ "E203", # Whitespace before ':' "E221", # Multiple spaces before operator "E226", # Missing whitespace around arithmetic operator "E241", # Multiple spaces after ',' ] +lint.isort.known-first-party = [ + "linkotron", +] +lint.isort.required-imports = [ + "from __future__ import annotations", +] -[tool.ruff.lint.isort] -known-first-party = ["linkotron"] -required-imports = ["from __future__ import annotations"] +[tool.pyproject-fmt] +max_supported_python = "3.13" [tool.pytest.ini_options] addopts = "--color=yes" From be029d843aabe7705e66383a2a3876bd8ada6d3c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:33:57 +0300 Subject: [PATCH 3/3] Upgrade pyproject-fmt to not lose a dependency --- .pre-commit-config.yaml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8f887b..12bc401 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: pass_filenames: false - repo: https://github.com/tox-dev/pyproject-fmt - rev: 2.1.3 + rev: 2.1.4 hooks: - id: pyproject-fmt diff --git a/pyproject.toml b/pyproject.toml index c1c8dff..3b4d96f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ dynamic = [ "version", ] dependencies = [ - 'pyperclip; platform_system == "Darwin"', - 'pyperclip; platform_system == "Windows"', + "pyperclip; platform_system=='Darwin'", + "pyperclip; platform_system=='Windows'", ] optional-dependencies.tests = [ "pytest",