use google convention for docstrings

This commit is contained in:
thomas girod
2024-07-12 09:34:16 +02:00
parent 07b625d4aa
commit 8c69a94488
72 changed files with 970 additions and 1694 deletions

View File

@ -90,12 +90,15 @@ def list_tags(s):
yield parts[1][len(tag_prefix) :]
def parse_semver(s):
"""
Turns a semver string into a 3-tuple or None if the parsing failed, it is a
prerelease or it has build metadata.
def parse_semver(s) -> tuple[int, int, int] | None:
"""Parse a semver string.
See https://semver.org
Returns:
A tuple, if the parsing was successful, else None.
In the latter case, it must probably be a prerelease
or include build metadata.
"""
m = semver_regex.match(s)
@ -106,7 +109,7 @@ def parse_semver(s):
):
return None
return (int(m.group("major")), int(m.group("minor")), int(m.group("patch")))
return int(m.group("major")), int(m.group("minor")), int(m.group("patch"))
def semver_to_s(t):

View File

@ -29,9 +29,7 @@ from django.core.management.commands import compilemessages
class Command(compilemessages.Command):
"""
Wrap call to compilemessages to avoid building whole env
"""
"""Wrap call to compilemessages to avoid building whole env."""
help = """
The usage is the same as the real compilemessages

View File

@ -30,9 +30,7 @@ from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Compiles scss in static folder for production
"""
"""Compiles scss in static folder for production."""
help = "Compile scss files from static folder"