Skip to content

Commit

Permalink
ruff updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasertl committed Jun 27, 2024
1 parent 97542b2 commit a7db2ad
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ca/ca/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application # NOQA isort:skip # pylint: disable=wrong-import-position
from django.core.wsgi import get_wsgi_application # isort:skip # pylint: disable=wrong-import-position

application = get_wsgi_application()

Expand Down
2 changes: 1 addition & 1 deletion ca/django_ca/acme/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def dispatch(self, request: HttpRequest, serial: str, slug: Optional[str] = None
response["replay-nonce"] = self.get_nonce()
return response

def post( # noqa: PLR0911,PLR0912
def post( # noqa: PLR0911
self, request: HttpRequest, serial: str, slug: Optional[str] = None
) -> AcmeResponse:
# pylint: disable=missing-function-docstring; standard Django view function
Expand Down
2 changes: 1 addition & 1 deletion ca/django_ca/management/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def add_certificate_authority_sign_extension_groups(self, parser: CommandParser)
)

# Common help text for extensions that are usually configured automatically.
default_hostname_suffix: "StrOrPromise" = ""
default_hostname_suffix: StrOrPromise = ""
if model_settings.CA_DEFAULT_HOSTNAME: # pragma: no branch
default_hostname_suffix = _(
" This extension is configured automatically using the CA_DEFAULT_HOSTNAME if not overridden "
Expand Down
2 changes: 1 addition & 1 deletion ca/django_ca/management/commands/import_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def add_arguments(self, parser: CommandParser) -> None:
"pem", help="Path to the public key (PEM or DER format).", type=argparse.FileType("rb")
)

def handle( # pylint: disable=too-many-locals # noqa: PLR0912, PLR0913
def handle( # pylint: disable=too-many-locals # noqa: PLR0913
self,
name: str,
key: typing.BinaryIO,
Expand Down
4 changes: 2 additions & 2 deletions ca/django_ca/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def format_other_name(other_name: x509.OtherName) -> str:
return f"{oid};{typ}:{value}"


def parse_general_name(name: ParsableGeneralName) -> x509.GeneralName: # noqa: PLR0911,PLR0912
def parse_general_name(name: ParsableGeneralName) -> x509.GeneralName: # noqa: PLR0911
"""Parse a general name from user input.
This function will do its best to detect the intended type of any value passed to it:
Expand Down Expand Up @@ -901,7 +901,7 @@ def parse_key_curve(value: str) -> ec.EllipticCurve:
.. deprecated:: 1.29.0
This function is no longer used internallay and will be removed in django-ca 2.0.0.
This function is no longer used internally and will be removed in django-ca 2.0.0.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion devscripts/commands/code_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Command(DevCommand):

def manage(self, *args: str) -> "subprocess.CompletedProcess[Any]":
"""Shortcut to run manage.py with warnings turned into errors."""
python: list[Union[str, "os.PathLike[str]"]] = ["python"]
python: list[Union[str, os.PathLike[str]]] = ["python"]

# Django 4.2 introduced a new way of handling storages
known_warnings = [
Expand Down
2 changes: 1 addition & 1 deletion devscripts/commands/docker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
parser.add_argument("--keep-image", action="store_true", default=False, help="Do not remove images.")
parser.add_argument("-l", "--list", action="store_true", help="List images and exit.")

def handle(self, args: argparse.Namespace) -> None: # noqa: PLR0912
def handle(self, args: argparse.Namespace) -> None:
docker_runs: list[DockerRunDict] = []

images = args.images or config.ALPINE_IMAGES
Expand Down
6 changes: 3 additions & 3 deletions devscripts/standalone/test-connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
print(f"Error setting up Django: {ex}")
sys.exit(1)

from django.core.cache import cache # NOQA: E402
from django.core.cache import cache

# pylint: disable=wrong-import-position # django_setup needs to be called first.
from ca.celery import app # noqa: E402
from django_ca.models import CertificateAuthority # noqa: E402
from ca.celery import app
from django_ca.models import CertificateAuthority

# Verify database connectivity by fetching a list of CAs. Even an empty list verifies connectivity.
list(CertificateAuthority.objects.all())
Expand Down

0 comments on commit a7db2ad

Please sign in to comment.