diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bfeaa72..30d65408 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,48 +14,35 @@ repos: rev: 1.8.0 hooks: - id: pyproject-fmt - - repo: https://github.com/rstcheck/rstcheck - rev: v6.2.0 - hooks: - - id: rstcheck - additional_dependencies: - - sphinx==6.1.3 - - tomli==2.0.1 - - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v0.9.1 - hooks: - - id: sphinx-lint - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 hooks: - id: pyupgrade args: [--py39-plus] + - repo: https://github.com/hadialqattan/pycln + rev: "v2.4.0" + hooks: + - id: pycln + args: [--all] + - repo: https://github.com/Lucas-C/pre-commit-hooks-markup + rev: v1.0.1 + hooks: + - id: rst-linter + - repo: https://github.com/adrienverge/yamllint + rev: "v1.35.1" + hooks: + - id: yamllint - repo: https://github.com/adamchainz/django-upgrade rev: 1.16.0 hooks: - id: django-upgrade args: [--target-version, "3.2"] - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 - hooks: - - id: black - - repo: https://github.com/adamchainz/blacken-docs - rev: 1.16.0 - hooks: - - id: blacken-docs - additional_dependencies: - - black==23.1.0 - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - name: isort (python) - - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - additional_dependencies: - - flake8-bugbear - - flake8-comprehensions - - flake8-logging - - flake8-tidy-imports + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.6.6 + hooks: + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format diff --git a/src/servestatic/storage.py b/src/servestatic/storage.py index 3aac9d31..b08f7a76 100644 --- a/src/servestatic/storage.py +++ b/src/servestatic/storage.py @@ -8,11 +8,13 @@ import re import textwrap from collections.abc import Iterator -from typing import Any, Tuple, Union +from typing import Any, Union from django.conf import settings -from django.contrib.staticfiles.storage import (ManifestStaticFilesStorage, - StaticFilesStorage) +from django.contrib.staticfiles.storage import ( + ManifestStaticFilesStorage, + StaticFilesStorage, +) from django.core.files.base import ContentFile from servestatic.compress import Compressor