From 448e83daeb177c0a6e41e3e25847094c383bfcce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 19:50:48 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v5.0.0) - [github.com/MarcoGorelli/auto-walrus: v0.2.2 → 0.3.4](https://github.com/MarcoGorelli/auto-walrus/compare/v0.2.2...0.3.4) - [github.com/astral-sh/ruff-pre-commit: v0.3.2 → v0.11.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.2...v0.11.8) - [github.com/psf/black: 24.2.0 → 25.1.0](https://github.com/psf/black/compare/24.2.0...25.1.0) - [github.com/codespell-project/codespell: v2.2.6 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.4.1) - [github.com/tox-dev/pyproject-fmt: 1.7.0 → v2.5.1](https://github.com/tox-dev/pyproject-fmt/compare/1.7.0...v2.5.1) - [github.com/abravalheri/validate-pyproject: v0.16 → v0.24.1](https://github.com/abravalheri/validate-pyproject/compare/v0.16...v0.24.1) --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0c53193..337ec0d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-yaml - id: detect-private-key @@ -24,34 +24,34 @@ repos: - --markdown-linebreak-ext=md - repo: https://github.com/MarcoGorelli/auto-walrus - rev: v0.2.2 + rev: 0.3.4 hooks: - id: auto-walrus - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.2 + rev: v0.11.8 hooks: - id: ruff # See pyproject.toml for args # args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 25.1.0 hooks: - id: black # See pyproject.toml for args - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell # See pyproject.toml for args additional_dependencies: - tomli - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.7.0 + rev: v2.5.1 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.24.1 hooks: - id: validate-pyproject From 53ea8f2146d73d7329f6129649f3df4f1c2f3d0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 19:50:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- BWBImportBot/__init__.py | 8 ++--- ia-bulkmarc-bot/bulk-import.py | 8 ++--- pyproject.toml | 61 ++++++++++++++++------------------ 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/BWBImportBot/__init__.py b/BWBImportBot/__init__.py index 043b3e38..557ccb99 100644 --- a/BWBImportBot/__init__.py +++ b/BWBImportBot/__init__.py @@ -1,10 +1,10 @@ #!/usr/bin/env python """ - __init__.py - ~~~~~~~~~~~ - :copyright: (c) 2020 by Internet Archive. - :license: AGPL v3 +__init__.py +~~~~~~~~~~~ +:copyright: (c) 2020 by Internet Archive. +:license: AGPL v3 """ __title__ = "bwbimportbot" diff --git a/ia-bulkmarc-bot/bulk-import.py b/ia-bulkmarc-bot/bulk-import.py index eb775585..788b26d4 100755 --- a/ia-bulkmarc-bot/bulk-import.py +++ b/ia-bulkmarc-bot/bulk-import.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 """ - Iterates over an archive.org bulk MARC item, such as OpenLibraries-Trent-MARCs, - and imports all records in all of its MARC files to Open Library. +Iterates over an archive.org bulk MARC item, such as OpenLibraries-Trent-MARCs, +and imports all records in all of its MARC files to Open Library. - USAGE: ./bulk-import.py +USAGE: ./bulk-import.py - Logs results to STDOUT +Logs results to STDOUT """ import argparse diff --git a/pyproject.toml b/pyproject.toml index cc92b322..beb9fc91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,25 +1,28 @@ [tool.ruff] +target-version = "py37" + +line-length = 616 select = [ - "C4", # flake8-comprehensions - "C90", # mccabe - "E", # pycodestyle - "F", # Pyflakes - "I", # isort - "ICN", # flake8-import-conventions - "PGH", # pygrep-hooks - "PIE", # flake8-pie - "PLC", # Pylint conventions - "PLE", # Pylint errors - "PLR091", # Pylint refactor just for max-args, max-branches, etc. - "PYI", # flake8-pyi - "RSE", # flake8-raise - "RUF", # Ruff-specific rules - "T10", # flake8-debugger - "TCH", # flake8-type-checking - "TID", # flake8-tidy-imports - "UP", # pyupgrade - "W", # pycodestyle - "YTT", # flake8-2020 + "C4", # flake8-comprehensions + "C90", # mccabe + "E", # pycodestyle + "F", # Pyflakes + "I", # isort + "ICN", # flake8-import-conventions + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "PLC", # Pylint conventions + "PLE", # Pylint errors + "PLR091", # Pylint refactor just for max-args, max-branches, etc. + "PYI", # flake8-pyi + "RSE", # flake8-raise + "RUF", # Ruff-specific rules + "T10", # flake8-debugger + "TCH", # flake8-type-checking + "TID", # flake8-tidy-imports + "UP", # pyupgrade + "W", # pycodestyle + "YTT", # flake8-2020 ] ignore = [ "E402", @@ -31,19 +34,11 @@ ignore = [ "PLC1901", "RUF001", ] -line-length = 616 -target-version = "py37" - -[tool.ruff.mccabe] -max-complexity = 21 - -[tool.ruff.pylint] -max-args = 8 -max-branches = 18 -max-statements = 73 - -[tool.ruff.per-file-ignores] -"test/*" = ["S101"] +per-file-ignores."test/*" = [ "S101" ] +pylint.max-args = 8 +pylint.max-branches = 18 +pylint.max-statements = 73 +mccabe.max-complexity = 21 [tool.codespell] ignore-words-list = 'didnt'