Skip to content

Commit

Permalink
Update hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed May 27, 2024
1 parent 9ab14a2 commit b4a3bc5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 54 deletions.
19 changes: 8 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
Expand All @@ -14,33 +14,30 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.13.0
rev: 1.17.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.272"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.5"
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.1.0
hooks:
- id: prettier
args: [--list-different, --no-semi]
exclude: "^conf/|.*\\.html$"
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.11.2
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.13
rev: v0.18
hooks:
- id: validate-pyproject
5 changes: 3 additions & 2 deletions email_hosts/management/commands/sendtestemailhosts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import socket

from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone

from email_hosts.backends import get_connection


Expand All @@ -23,7 +24,7 @@ def add_arguments(self, parser):
)

def handle(self, *args, **kwargs):
subject = "Test email from %s on %s" % (socket.gethostname(), timezone.now())
subject = f"Test email from {socket.gethostname()} on {timezone.now()}"

send_mail(
subject=subject,
Expand Down
79 changes: 38 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ requires = [
name = "django-email-hosts"
description = "Support for several SMTP configurations in a single site"
readme = "README.rst"
license = {text = "BSD-3-Clause"}
license = { text = "BSD-3-Clause" }
authors = [
{ name = "Feinheit AG", email = "[email protected]" },
{ name = "Feinheit AG", email = "[email protected]" },
]
requires-python = ">=3.9"
classifiers = [
Expand All @@ -30,80 +30,77 @@ dynamic = [
"version",
]
dependencies = [
"Django>=3.2",
"django>=3.2",
"speckenv>=3.2",
]
[project.optional-dependencies]
tests = [
optional-dependencies.tests = [
"coverage",
]
[project.urls]
Homepage = "https://github.com/feinheit/django-email-hosts/"
urls.Homepage = "https://github.com/feinheit/django-email-hosts/"

[tool.hatch.version]
path = "email_hosts/__init__.py"

[tool.hatch.build.targets.wheel]
packages = ["email_hosts"]
packages = [
"email_hosts",
]

[tool.ruff]
extend-select = [
# pyflakes, pycodestyle
"F", "E", "W",
# mmcabe
"C90",
# isort
"I",
# pep8-naming
"N",
# pyupgrade
"UP",
# flake8-2020
"YTT",
# flake8-boolean-trap
"FBT",
target-version = "py39"

fix = true
show-fixes = true
lint.extend-select = [
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# mmcabe
"C90",
# flake8-django
"DJ",
"E",
# pyflakes, pycodestyle
"F",
# flake8-boolean-trap
"FBT",
# flake8-logging-format
"G",
# flake8-pie
"PIE",
# flake8-simplify
"SIM",
# isort
"I",
# flake8-gettext
"INT",
# pep8-naming
"N",
# pygrep-hooks
"PGH",
# flake8-pie
"PIE",
# pylint
"PL",
# unused noqa
"RUF100",
# flake8-simplify
"SIM",
# pyupgrade
"UP",
"W",
# flake8-2020
"YTT",
]
extend-ignore = [
lint.extend-ignore = [
# Allow zip() without strict=
"B905",
# No line length errors
"E501",
]
fix = true
show-fixes = true
target-version = "py39"

[tool.ruff.isort]
combine-as-imports = true
lines-after-imports = 2

[tool.ruff.mccabe]
max-complexity = 15

[tool.ruff.per-file-ignores]
"*/migrat*/*" = [
lint.per-file-ignores."*/migrat*/*" = [
# Allow using PascalCase model names in migrations
"N806",
# Ignore the fact that migration files are invalid module names
"N999",
]
lint.isort.combine-as-imports = true
lint.isort.lines-after-imports = 2
lint.mccabe.max-complexity = 15

0 comments on commit b4a3bc5

Please sign in to comment.